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
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;