Returns the current role. The current role can be set with SET ROLE or SET DEFAULT ROLE.
CURRENT_ROLE, CURRENT_ROLE()Returns the current role name. The return value is a string in the utf8 character set.
If there is no current role, NULL is returned.
returns the combination of user and host used to login. returns the account used to determine current connection's privileges.
Statements using the CURRENT_ROLE function are not .
This page is licensed: CC BY-SA / Gnu FDL
SELECT CURRENT_ROLE;
+--------------+
| CURRENT_ROLE |
+--------------+
| NULL |
+--------------+
SET ROLE staff;
SELECT CURRENT_ROLE;
+--------------+
| CURRENT_ROLE |
+--------------+
| staff |
+--------------+