Re: About the function current_user

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Xiong He <iihero(at)qq(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: About the function current_user
Date: 2023-03-20 07:05:45
Message-ID: CAFj8pRD-_mptStv288kHAPE4UeeJR1cXALioJgG1wNQ_oR-pPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi

po 20. 3. 2023 v 8:01 odesílatel Xiong He <iihero(at)qq(dot)com> napsal:

> Dear All,
>
> Just confused, why :
> postgres=# select current_user;
> current_user
> --------------
> postgres
> (1 row)
>
> postgres=# select current_user();
> 2023-03-20 07:00:02.981 UTC [17281] ERROR: syntax error at or near "(" at
> character 20
> 2023-03-20 07:00:02.981 UTC [17281] STATEMENT: select current_user();
> ERROR: syntax error at or near "("
> LINE 1: select current_user();
> ^
>
> 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.

Regards

Pavel

> But the similar function current_database and current_database(), both can
> work.
>
> Regards,
> Xiong He [iihero]
>
>
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2023-03-20 08:16:52 Re: About the function current_user
Previous Message Xiong He 2023-03-20 07:01:28 About the function current_user