Skip to content

SESSION_USER

SELECT SESSION_USER;
session_user
------------------
postgres
(1 row)

The SESSION_USER is a system information function in PostgreSQL. It returns the name of the current user executing the query. In the given example, it returns ‘postgres’ as currently the query is executed through this user.