All pages
Powered by GitBook
1 of 1

Loading...

Information Schema ENABLED_ROLES Table

The Information Schema ENABLED_ROLES table lists all roles that are currently enabled for the current session, including nested roles.

The Information Schema ENABLED_ROLES table shows the enabled roles for the current session.

It contains the following column:

Column
Description

ROLE_NAME

The enabled role name, or NULL.

This table lists all roles that are currently enabled, one role per row — the current role, roles granted to the current role, roles granted to these roles and so on. If no role is set, the row contains a NULL value.

The roles that the current user can enable are listed in the Information Schema table.

See also .

Examples

This page is licensed: CC BY-SA / Gnu FDL

SELECT * FROM information_schema.ENABLED_ROLES;
+-----------+
| ROLE_NAME |
+-----------+
| NULL      |
+-----------+

SET ROLE staff;

SELECT * FROM information_schema.ENABLED_ROLES;
+-----------+
| ROLE_NAME |
+-----------+
| staff     |
+-----------+
APPLICABLE_ROLES
CURRENT_ROLE()