DROP ROW ACCESS POLICY
Introduced or updated: v1.2.845
ROW ACCESS POLICY is an Enterprise Edition feature. Contact Databend Support for a license.
Deletes an existing row access policy from Databend. Before dropping a policy, detach it from all tables that reference it.
Syntax
DROP ROW ACCESS POLICY [ IF EXISTS ] <policy_name>
Access Control Requirements
| Privilege | Description |
|---|---|
| APPLY ROW ACCESS POLICY | Required to drop a row access policy unless you own that policy. |
You must have the global APPLY ROW ACCESS POLICY privilege or APPLY/OWNERSHIP on the target policy. Databend automatically revokes OWNERSHIP from the creator role after the policy is dropped.
Examples
SET enable_experimental_row_access_policy = 1;
CREATE ROW ACCESS POLICY rap_engineering
AS (dept STRING)
RETURNS BOOLEAN -> dept = 'Engineering';
CREATE TABLE employees(id INT, department STRING);
ALTER TABLE employees ADD ROW ACCESS POLICY rap_engineering ON (department);
-- Detach the policy before dropping it.
ALTER TABLE employees DROP ROW ACCESS POLICY rap_engineering;
DROP ROW ACCESS POLICY rap_engineering;