Guy Rouillier <guy.rouill...@gmail.com> writes:
> Ugh, I just noticed the quotation marks around the timestamp function. 
> This works:

> select "timestamp"(now()::timestamptz); => timestamp without time zone

> This is a subtlety bound to be lost on most.  Why is there both a 
> function and a type name with the same name?

All cast functions are named after the target type, by convention.

> I suppose I could define a 
> synonym to make the function name distinct, but this seems like 
> something that should be addressed.

Really the right way to address it is to use cast notation.  The
function notation is sometimes convenient, but you have to worry
about gotchas like this one, not to mention that some built-in
types have multiple aliases.

                        regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to