DROP ROW ACCESS POLICY¶
Removes a row access policy from the system.
- See also:
DROP ROW ACCESS POLICY [ IF EXISTS ] <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¶
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 additional details on masking policy DDL and privileges, see Managing Row Access Policies.
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>'));
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
UNDROPwith row access policy objects. Using
UNDROPtriggers an error message. For more information on this error message, see Troubleshooting Row Access Policies.
If a table column has a row access policy attached to it, the column cannot be dropped from the table.
The following example drops a row access policy from a table.
drop row access policy rap_table_employee_info;