CREATE CAST requires immutable cast function? 
Author Message
 CREATE CAST requires immutable cast function?

It says here that CREATE CAST insists the cast function be immutable.
This seems wrong to me, in view of the fact that we have numerous
built-in casts that don't adhere to that rule --- for example,
timestamptz(date) is not immutable because it depends on the timezone
setting.

Perhaps there's a case for prohibiting volatile casts (as opposed to
stable ones), but I don't really see it.  I'd prefer to just remove
this restriction.  Comments?

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.***.com/



Thu, 17 Feb 2005 10:42:31 GMT
 CREATE CAST requires immutable cast function?

Quote:

> Perhaps there's a case for prohibiting volatile casts (as opposed to
> stable ones), but I don't really see it.  I'd prefer to just remove
> this restriction.  Comments?

Volatile casts can blow up.  I am sure that is the reasoning.  ;-)

--
  Bruce Momjian                        |  http://candle.pha.pa.us

  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------



Thu, 17 Feb 2005 10:45:17 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. CREATE CAST requires immutable cast function?

2. CREATE CAST WITHOUT FUNCTION should require superuserness?

3. check validity of cast before performing cast?

4. cast function to integer

5. cast function

6. Need help with type casting on numeric values from AVG aggregate functions

7. CAST Function question

8. Can you CAST the getdate function ?

9. cast function, character to integer

10. CAST function issue.

11. CAST and CONVERT functions


 
Powered by phpBB® Forum Software