Re: predefined functions
| От | Tom Lane |
|---|---|
| Тема | Re: predefined functions |
| Дата | |
| Msg-id | 19372.1160286291@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | predefined functions (Rafal Pietrak <rafal@poczta.homelinux.com>) |
| Ответы |
Re: predefined functions
|
| Список | pgsql-general |
Rafal Pietrak <rafal@poczta.homelinux.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
В списке pgsql-general по дате отправления: