current_user

A function returning the current user name

current_user is a system function returning the name of the current role under which statements will be executed.

current_user was added in PostgreSQL 6.3.

Change history

Examples

Basic usage example for current_user:

postgres=# SELECT current_user;
 current_user 
--------------
 postgres
(1 row)

Categories

System function, Users and roles

See also

current_role