PostgreSQL – Get current user

Run the below select statement to obtain the username of the current session in Postgres database.

select current_user;
See also  PostgreSQL - Remove all special characters from a string