PostgreSQL current_user

PostgreSQL current_user returns the name of the current user (the user of the current execution context).

The current_user Equivalent to current_role().

current_user Syntax

Here is the syntax of the PostgreSQL current_user function:

current_user -> name

Parameters

PostgreSQL current_user does not require any parameters.

Return value

PostgreSQL current_user returns the name of the current user (the user of the current execution context).

current_user Examples

To get the user of the current execution context, use the SELECT statement with current_user:

SELECT current_user;
 current_user
--------------
 postgres