USERNAME
Returns a VARCHAR containing the name of the user who initiated the current database connection.
Returns a VARCHAR containing the name of the user who initiated the current database connection.
Behavior type
StableSyntax
USERNAME()
Notes
-
This function is useful for permission checking.
-
USERNAME is equivalent to CURRENT_USER, SESSION_USER and USER.
Examples
=> SELECT USERNAME();
username
--------------
dbadmin
(1 row)