View a markdown version of this page

SVV_ATTACHED_MASKING_POLICY - Amazon Redshift

Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026. We will start enforcing it in phases. For more information on the details of Python end of life and migration options, see the blog post that was published on June 30, 2025.

SVV_ATTACHED_MASKING_POLICY

Use SVV_ATTACHED_MASKING_POLICY to view all the relations and roles/users with policies attached on the currently connected database.

Only superusers and users with the sys:secadmin role can view SVV_ATTACHED_MASKING_POLICY. Regular users will see 0 rows.

Table columns

Column name Data type Description
policy_name text The name of the masking policy attached to the table.
schema_name text The schema of the table to which the policy is attached.
table_name text The name of the table to which the policy is attached.
table_type text The type of the table to which the policy is attached.
grantor text The name of the user that attached the policy.
grantee text The name of the user/role to whom the policy is attached.
grantee_type text The type of grantee. This can be role, user, or public.
priority int The priority of the attached policy.
input_columns text The input column attributes of the attached policy.
output_columns text The output column attributes of the attached policy.
is_masking_datashare_on boolean Whether the table to which the policy is attached is DDM-protected over datashares.

Internal functions

SVV_ATTACHED_MASKING_POLICY supports the following internal functions:

mask_get_policy_for_role_on_column

Get the highest priority policy that applies to a given column/role pair.

Syntax

mask_get_policy_for_role_on_column (relschema, relname, colname, rolename);

Parameters

relschema

The name of the schema the policy is in.

relname

The name of the table the policy is in.

colname

The name of the column the policy is attached to.

rolename

The name of the role the policy is attached to.

mask_get_policy_for_user_on_column

Get the highest priority policy that applies to a given column/user pair.

Syntax

mask_get_policy_for_user_on_column (relschema, relname, colname, username);

Parameters

relschema

The name of the schema the policy is in.

relname

The name of the table the policy is in.

colname

The name of the column the policy is attached to.

rolename

The name of the user the policy is attached to.