Skip to main content

SHOW POLICIES

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 16.4 and above check marked yes Unity Catalog only

Lists policies associated with a securable. Two forms are supported:

  1. SHOW POLICIES — Lists only the policies directly associated with the target securable.
  2. 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.

  • catalog_name

    The name of the catalog. Policies defined on this catalog are listed.

  • schema_name

    The name of the schema. Policies defined on this schema are listed.

  • table_name

    The name of the table. Policies defined on this table are listed.

Result

The statement returns a result table.

SHOW POLICIES

  • Policy Name STRING NOT NULL: Name of the policy.
  • Policy Type STRING NOT NULL: Type of the policy (for example, ROW_FILTER or COLUMN_MASK).
  • Catalog STRING NOT NULL: Catalog of the securable the policy is defined on.
  • Schema STRING: Schema of the securable, or NULL when the target is a catalog.
  • Table STRING: Table name when the policy is defined on a table, or NULL otherwise.
  • Comment STRING: Comment on the policy, if any.

SHOW EFFECTIVE POLICIES

  • Policy Name STRING NOT NULL: Name of the policy.
  • Policy Type STRING NOT NULL: Type of the policy (for example, ROW_FILTER or COLUMN_MASK).
  • Catalog STRING NOT NULL: Catalog where the policy is defined (direct or inherited).
  • Schema STRING: Schema where the policy is defined, or NULL when defined on a catalog.
  • Table STRING: Table where the policy is defined, or NULL when defined on catalog or schema.
  • Comment STRING: 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

SQL
> SHOW POLICIES ON SCHEMA mycatalog.myschema;
> SHOW EFFECTIVE POLICIES ON SCHEMA mycatalog.myschema;