Removes a row access policy from the system.
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.
A role used to execute this operation 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).
The USAGE privilege on the parent database and schema are required to perform operations on any object in a 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.
When the IF EXISTS clause is specified and the target object doesn’t exist, the command completes successfully without returning an error.
The following example drops a row access policy from a table.
DROP ROW ACCESS POLICY rap_table_employee_info;Copy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4