SHOW DATABASE ROLES¶
Lists all the database roles in a specified database.
A user with any active role that has been granted any privilege on the active database (e.g. USAGE) can list the database roles in the database. However, this does not necessarily mean the role allows users to use the database roles to perform SQL actions. To use a database role, it must first be granted to an account role that users can activate in a user session, or to an account role lower in a hierarchy.
This is a part of Discretionary Access Control and Role-Based Access Control. For more information, see Overview of Access Control.
- See also:
SHOW GRANTS , CREATE DATABASE ROLE , ALTER DATABASE ROLE , DROP DATABASE ROLE
SHOW DATABASE ROLES IN DATABASE <db_name>
IN DATABASE db_name
The scope of the command, which is always a specified database. The command returns a user error if no database name is specified.
The command does not require a running warehouse to execute.
To post-process the output of this command, you can use the RESULT_SCAN function, which treats the output as a table that can be queried.
Show all database roles in the
SHOW DATABASE ROLES IN DATABASE db1;