CURRENT_USER returns a VARCHAR containing the name of the user who initiated the current database connection.
Syntax
CURRENT_USER
Notes
- This function must be called without trailing parentheses.
- CURRENT_USER is useful for permission checking
- CURRENT_USER is equivalent to SESSION_USER and USER.
Examples
=> SELECT CURRENT_USER;
current_user
--------------
dbadmin
(1 row)