📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

DROP ROW ACCESS POLICY



Deletes an existing row access policy from TiDB Cloud Lake. 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. TiDB Cloud Lake 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;

Was this page helpful?