OK then this fix is committed in 1072, hardcodes against the list below (case-insensitively) for "non-parenthesis" operation.

On Mar 1, 2006, at 2:12 PM, Jonathan Ellis wrote:

On 3/1/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
this is very concerning, since other Postgresql functions only work
if you *dont* put parenthesis, like "current_date".  the parenthesis
logic is currently based on the existence of arguments and was
explicitly added for that reason.

In that respect, postgresql is following the ANSI SQL standard.  So it's not really their fault, except for the decision to adhere to the standard as much as possible. :)
 
so, we will either have to add a flag to "func" to indicate "no
parenthesis", or somehow hardcode the postgres module to "know" when
it needs to put parenthesis and when it doesnt, which seems like it
would mean hardcoding of all the "non-parenthesis" function names.

I believe this is the full list:

CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_DATE
LOCAL_TIME
LOCAL_TIMESTAMP
CURRENT_USER
SESSION_USER
USER

I don't know of a way to derive this from the system tables, but maybe someone on the postgresql hackers list would.  But since the SQL standard only gets updated every 5 years or so it should be relatively stable.

--
Jonathan Ellis
http://spyced.blogspot.com

Reply via email to