Skip to main content

DROP ROW ACCESS POLICY

Introduced or updated: v1.2.845
ENTERPRISE EDITION FEATURE
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

PrivilegeDescription
APPLY ROW ACCESS POLICYRequired 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;
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today