SHOW POLICIES
Applies to: Databricks SQL
Databricks Runtime 16.4 and above
Unity Catalog only
Lists policies associated with a securable. Two forms are supported:
- SHOW POLICIES — Lists only the policies directly associated with the target securable.
- SHOW EFFECTIVE POLICIES — Lists policies directly associated with the target securable and policies inherited from parents in the resource hierarchy.
The same permission is checked for both forms. No additional permissions are required on parent securables. For example, showing effective policies on a table does not require permission to show policies on the schema or catalog.
Syntax
SHOW [ EFFECTIVE ] POLICIES ON { CATALOG catalog_name | SCHEMA schema_name | TABLE table_name }
Parameters
-
EFFECTIVE
Optional. When specified, lists policies directly associated with the target securable and policies inherited from parents in the resource hierarchy. When omitted, lists only the policies directly associated with the target securable.
-
The name of the catalog. Policies defined on this catalog are listed.
-
The name of the schema. Policies defined on this schema are listed.
-
The name of the table. Policies defined on this table are listed.
Result
The statement returns a result table.
SHOW POLICIES
Policy NameSTRING NOT NULL: Name of the policy.Policy TypeSTRING NOT NULL: Type of the policy (for example,ROW_FILTERorCOLUMN_MASK).CatalogSTRING NOT NULL: Catalog of the securable the policy is defined on.SchemaSTRING: Schema of the securable, or NULL when the target is a catalog.TableSTRING: Table name when the policy is defined on a table, or NULL otherwise.CommentSTRING: Comment on the policy, if any.
SHOW EFFECTIVE POLICIES
Policy NameSTRING NOT NULL: Name of the policy.Policy TypeSTRING NOT NULL: Type of the policy (for example,ROW_FILTERorCOLUMN_MASK).CatalogSTRING NOT NULL: Catalog where the policy is defined (direct or inherited).SchemaSTRING: Schema where the policy is defined, or NULL when defined on a catalog.TableSTRING: Table where the policy is defined, or NULL when defined on catalog or schema.CommentSTRING: Comment on the policy, if any.
The table includes policies directly on the target securable and, for SHOW EFFECTIVE POLICIES, policies inherited from parents in the resource hierarchy. To see full details of a policy, use DESCRIBE POLICY.
Examples
> SHOW POLICIES ON SCHEMA mycatalog.myschema;
> SHOW EFFECTIVE POLICIES ON SCHEMA mycatalog.myschema;