SHOW DATABASE ROLES¶
Lists all the database roles in a specified database.
Important
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
Syntax¶
SHOW DATABASE ROLES IN DATABASE <db_name>
Required Parameters¶
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.
Usage Notes¶
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.