From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Rafal Pietrak <rafal(at)poczta(dot)homelinux(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: predefined functions |
Date: | 2006-10-08 05:44:51 |
Message-ID: | 19372.1160286291@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Rafal Pietrak <rafal(at)poczta(dot)homelinux(dot)com> writes:
> Is there a reason why both:
> SELECT current_user;
> SELECT current_database();
> are correct, while neither of:
> SELECT current_user(); -- syntax at '('
> SELECT current_database; -- missing column
> is?
Yeah: current_user (without the parens) is specified by the SQL
standard, but we're not about to adopt such a brain-dead syntax
for any of the functions defined by Postgres itself --- as you
can see from the error messages, allowing a function to be called
without parens creates a word that can't be used as a column name.
So if current_database could be called without parens, we'd actually
be violating the SQL spec by reserving a word that's not reserved
per spec.
Consistency is not one of the hallmarks of the SQL standard :-(
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Eberhard Lisse | 2006-10-08 07:43:38 | Re: Potentially annoying question about date ranges (part 2) |
Previous Message | stevegy | 2006-10-08 05:19:32 | Re: Hi, For the UTF-8 encoding |