Skip to content

CURRENT_USER

Return the user currently subject to permission checking, which may or may not be the same user who initiated the session.

CURRENT_USER | USER

For example:

premdb=# \c premdb yellowbrick
You are now connected to database "premdb" as user "yellowbrick".
premdb=# select current_user;
 current_user 
--------------
 yellowbrick
(1 row)

USER is a synonym for CURRENT_USER.

Parent topic:System Functions