DROP ROW ACCESS POLICY¶

Removes a row access policy from the system.

See also:

Row access policy DDL

Syntax¶

DROP ROW ACCESS POLICY [ IF EXISTS ] <name>
Copy

Parameters¶

name

Identifier for the row access policy; must be unique for your account.

The identifier value must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. "My object"). Identifiers enclosed in double quotes are also case-sensitive.

For more details, see Identifier requirements.

Access control requirements¶

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

OWNERSHIP

Schema or

Row access policy

The schema that contains the row access policy.

OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege).

Note that operating on any object in a schema also requires the USAGE privilege on the parent database and schema.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

For additional details on masking policy DDL and privileges, see Manage row access policies.

Usage notes¶

  • Prior to dropping a row access policy, execute the following statement to determine if the row access policy is applied to any tables or views. For more information, see POLICY_REFERENCES.

    SELECT * from table(information_schema.policy_references(policy_name=>'<string>'));
    
    Copy
  • A row access policy cannot be dropped successfully if it is currently attached to a resource. Before executing a DROP statement, detach the row access policy from the table or view with an ALTER TABLE or ALTER VIEW statement as shown in ALTER TABLE or ALTER VIEW.

  • Snowflake does not support UNDROP with row access policy objects. Using UNDROP triggers an error message. For more information on this error message, see Troubleshoot row access policies.

  • If a table column has a row access policy attached to it, the column cannot be dropped from the table.

Example¶

The following example drops a row access policy from a table.

DROP ROW ACCESS POLICY rap_table_employee_info;
Copy