Skip to main content
The SHOW ROLES lists the roles for all databases.
Since the keywords ROLES and USERS can now be used interchangeably in SQL statements for enhanced PostgreSQL compatibility, SHOW ROLES is now an alias for .

Synopsis

show_roles syntax diagram

Parameters

Required privileges

The role must have the on the system.users and system.role_members tables.

Examples

Show all roles

Filter roles by provisioning source

To find all roles provisioned by a specific source, such as an :
The SOURCE filter matches against the role option, which is set automatically for roles provisioned through , , or authentication.

Filter roles by last login time

To find roles that have not logged in since a specific date:
Roles that have never logged in (NULL estimated_last_login_time) are excluded from LAST LOGIN BEFORE results.

Combine filters with a limit

You can combine multiple WITH options (comma-separated) and add a LIMIT clause:

Limit results

The LIMIT clause can also be used without WITH options:

See also