TABLE_PRIVILEGES
Applies to: Databricks SQL Databricks Runtime 10.4 LTS and above Unity Catalog only
INFORMATION_SCHEMA.TABLE_PRIVILEGES lists principals that have privileges on a table in a catalog schema.
Definition
The TABLE_PRIVILEGES
relation contains the following columns:
Name | Data type | Nullable | Standard | Description |
---|---|---|---|---|
GRANTOR |
STRING |
No | Yes | Principal that granted the privilege. |
GRANTEE |
STRING |
No | Yes | Principal to which the privilege is granted. |
TABLE_CATALOG |
STRING |
No | Yes | Catalog of relation on which the privilege is granted. |
TABLE_SCHEMA |
STRING |
No | Yes | Schema of relation on which the privilege is granted. |
TABLE_NAME |
STRING |
No | Yes | Relation on which the privilege is granted. |
PRIVILEGE_TYPE |
STRING |
No | Yes | Privilege being granted. |
IS_GRANTABLE |
STRING |
No | Yes | Always NO . Reserved for future use. |
INHERITED_FROM |
STRING |
No | No | The ancestor relation that the privilege is inherited from. |
Constraints
The following constraints apply to the TABLE_PRIVILEGES
relation:
Class | Name | Column List | Description |
---|---|---|---|
Primary key | TABLEPRIVS_PK |
GRANTOR , GRANTEE , TABLE_CATALOG , TABLE_SCHEMA , TABLE_NAME , PRIVILEGE_TYPE |
Unique identifier for the granted privilege. |
Foreign key | TABLEPRIVS_TABLES_FK |
TABLE_CATALOG , TABLE_SCHEMA , TABLE_NAME |
References TABLES |
Examples
> SELECT table_catalog, table_schema, table_name, grantee
FROM information_schema.table_privileges;