Топ-100
top of page
CerebroSQL

SET ROLE

RDBMS Type: PostgreSQL

Topic

SET [ SESSION | LOCAL ] ROLE rolename
SET [ SESSION | LOCAL ] ROLE NONE
RESET ROLE

Example

SELECT SESSION_USER, CURRENT_USER;

session_user | current_user
--------------+--------------
peter | peter

SET ROLE 'paul';

SELECT SESSION_USER, CURRENT_USER;

session_user | current_user
--------------+--------------
peter | paul

bottom of page