Re: About the function current_user

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: About the function current_user
Дата
Msg-id 89A42BDF-D1C2-4D28-9970-54EA3EF60815@yesql.se
обсуждение исходный текст
Ответ на Re: About the function current_user  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: About the function current_user  (John Naylor <john.naylor@enterprisedb.com>)
Re: About the function current_user  ("Xiong He" <iihero@qq.com>)
Список pgsql-bugs
> On 20 Mar 2023, at 08:05, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> po 20. 3. 2023 v 8:01 odesílatel Xiong He <iihero@qq.com <mailto:iihero@qq.com>> napsal:

> why current_user() is not recognized?
>
> this is not real function - it is pseudo constant
>
> The real function in postgres has a record in the pg_proc table.

The syntax of current_user and current_role are mandated by the SQL
specification, we have this note in the documentation:

    "current_catalog, current_role, current_schema, current_user,
    session_user, and user have special syntactic status in SQL: they must
    be called without trailing parentheses.  In PostgreSQL, parentheses can
    optionally be used with current_schema, but not with the others."

Given that current_schema and other current_xx functions accept parenthesis
it's easy to understand the confusion though.

--
Daniel Gustafsson




В списке pgsql-bugs по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: About the function current_user
Следующее
От: John Naylor
Дата:
Сообщение: Re: About the function current_user