Schema:

ACCOUNT_USAGE

POLICY_REFERENCES View

This Account Usage view can be used to identify the objects and columns on which a masking policy is set or the tables and views in which a row access policy is set.

The view is complementary to the information schema table function POLICY_REFERENCES.

Columns

Column Name

Data Type

Description

POLICY_DB

TEXT

The database in which the policy is set.

POLICY_SCHEMA

TEXT

The schema in which the policy is set.

POLICY_ID

NUMBER

Internal/system-generated identifier for the policy.

POLICY_NAME

TEXT

The name of the policy.

POLICY_KIND

TEXT

The type of policy.

REF_DATABASE_NAME

TEXT

The name of the database containing an object that the queried object references.

REF_SCHEMA_NAME

TEXT

The name of the schema containing an object that the queried object references.

REF_ENTITY_NAME

TEXT

The name of the object (i.e. table_name, view_name, external_table_name) on which the policy is set.

REF_ENTITY_DOMAIN

TEXT

The object type (i.e. table, view) on which the policy is set.

REF_COLUMN_NAME

TEXT

The column name on which the policy is set.

REF_ARG_COLUMN_NAMES

ARRAY

Returns NULL for rows in the query result in which a Column-level Security masking policy is set.

TAG_DATABASE

TEXT

The name of the database containing the tag that has a policy assigned to the tag or NULL if a policy is not assigned to the tag.

TAG_SCHEMA

TEXT

The name of the schema containing the tag that has a policy assigned to the tag or NULL if a policy is not assigned to the tag.

TAG_NAME

TEXT

The name of the tag that has a policy assigned to it or NULL if a policy is not assigned to the tag.

POLICY_STATUS

TEXT

Specifies the status of the policy, which can be one of four possible values: ACTIVE, MULTIPLE_MASKING_POLICY_ASSIGNED_TO_THE_COLUMN, COLUMN_IS_MISSING_FOR_SECONDARY_ARG, or COLUMN_DATATYPE_MISMATCH_FOR_SECONDARY_ARG.

Note the following for the POLICY_STATUS column:

ACTIVE

Specifies that the column (i.e. REF_COLUMN_NAME) is only associated with a single policy by a tag.

MULTIPLE_MASKING_POLICY_ASSIGNED_TO_THE_COLUMN

Specifies that multiple masking policies are assigned to the same column.

COLUMN_IS_MISSING_FOR_SECONDARY_ARG

Specifies that the policy (i.e. POLICY_NAME) is a conditional masking policy and the table (i.e. REF_ENTITY_NAME) does not have a column with the same name.

COLUMN_DATATYPE_MISMATCH_FOR_SECONDARY_ARG

Specifies that the policy is a conditional masking policy and the table has a column with the same name but a different data type than the data type in the masking policy signature.

Usage Notes

  • Latency for the view may be up to 120 minutes (2 hours).

  • The view only displays objects for which the current role for the session has been granted access privileges.

Back to top