SHOW GRANTS lists one of the following:
- The granted to in a cluster.
- The to on , , , , , or .
Syntax
Show privilege grants
Use the following syntax to show the privileges granted to users on database objects:DATABASE is omitted, the schema, tables, and types in the are listed.
Show role grants
Use the following syntax to the show the role grants for users in a cluster.Parameters
| Parameter | Description |
|---|---|
targets | A comma-separated list of database, function, schema, table, or user-defined type names. If the function name is not unique, you must provide the full function signature. To list the privilege grants for all tables in the current database, you can use SHOW GRANTS ON TABLE \*. |
users | A comma-separated list of the whose privileges or roles you want to show. |
roles | A comma-separated list of the roles whose grants you want to show. |
Response
Privilege grants
TheSHOW GRANTS ON [DATABASE | FUNCTION | SCHEMA | TABLE | TYPE | EXTERNAL CONNECTION] statement can return the following fields, depending on the target object specified:
| Field | Description |
|---|---|
database\_name | The name of the database. |
function\_name | The name of the user-defined function. |
schema\_name | The name of the schema. |
table\_name | The name of the table. |
type\_name | The name of the user-defined type. |
connection\_name | The name of the external connection. |
grantee | The name of the user or role that was granted the . |
privilege\_type | The name of the privilege. |
is\_grantable | TRUE if the grantee has the grant option on the object; FALSE if not. |
Role grants
TheSHOW GRANTS ON ROLE statement returns the following fields:
| Field | Description |
|---|---|
role\_name | The name of the role. |
member | The users in the role. |
is\_admin | If true, the role is an role. |
Required privileges
- No are required to view privileges granted to users.
- For
SHOW GRANTS ON ROLES, the user must have the on the system table.
Examples
Show all grants
To list all grants for all users and roles on the current database and its tables:Show a specific user or role’s grants
Show grants on databases
Specific database, all users and roles:Show grants on tables
Show grants on schemas
Show grants on user-defined types
To show privileges on , use the following statements.Show grants on user-defined functions
To show the grants defined on thenum_users function created in , run:

