Re: About the function current_user - Mailing list pgsql-bugs

From Pavel Stehule
Subject Re: About the function current_user
Date
Msg-id CAFj8pRD-_mptStv288kHAPE4UeeJR1cXALioJgG1wNQ_oR-pPQ@mail.gmail.com
Whole thread Raw
In response to About the function current_user  ("Xiong He" <iihero@qq.com>)
Responses Re: About the function current_user  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-bugs
Hi


po 20. 3. 2023 v 8:01 odesílatel Xiong He <iihero@qq.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] 


 

pgsql-bugs by date:

Previous
From: "Xiong He"
Date:
Subject: About the function current_user
Next
From: Daniel Gustafsson
Date:
Subject: Re: About the function current_user