On Sep 5, 2007, at 15:31 , Ottó Havasvölgyi wrote:
What is the cause that "now()" works but "now" does not and
now() is a PostgreSQL extension and not required by the SQL spec. For the most part, PostgreSQL extensions are functions and look like them. CURRENT_TIMESTAMP and CURRENT_DATE are required by the SQL spec and return the appropriate values. IIRC, they call now() with casts, if appropriate.
"current_user" works
IIRC, CURRENT_USER (without parens) is required by the SQL spec. It's most likely implemented in PostgreSQL using the current_user function and special rules are added to the grammar to allow CURRENT_USER to be accepted without parens.
How can I decide if a function needs parentheses or not if it has no parameters?
Via the documentation. In general functions require parens. AIUI its only when they are also SQL keywords that the parens are omitted (as required by the spec).
Michael Glaesemann grzm seespotcode net ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend