Skip to main content
The 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:
When 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

Response

Privilege grants

The SHOW GRANTS ON [DATABASE | FUNCTION | SCHEMA | TABLE | TYPE | EXTERNAL CONNECTION] statement can return the following fields, depending on the target object specified:

Role grants

The SHOW GRANTS ON ROLE statement returns the following fields:

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:
Specific database, specific user or role:

Show grants on tables

Specific table, all users and roles:
Specific table, specific role or user:
All tables, all users and roles:
All tables, specific users or roles:

Show grants on schemas

Specific schema, all users or roles:
Specific schema, specific users or roles:

Show grants on user-defined types

To show privileges on , use the following statements.
Specific type, all users or roles:
Specific type, specific users or roles:

Show grants on user-defined functions

To show the grants defined on the num_users function created in , run:

Show all grants on external connections

To show all grants defined on an , run:

Show grants on external connections by user

To show the grants defined on an for a specific user, run:

Show role memberships

All members of all roles:
Members of a specific role:
Roles of a specific user or role:

See also