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

DROP MASKING POLICY



Deletes an existing masking policy from TiDB Cloud Lake. When you drop a masking policy, it is removed from TiDB Cloud Lake, and its associated masking rules are no longer in effect. Please note that, before dropping a masking policy, ensure that this policy is not associated with any columns.

Syntax

DROP MASKING POLICY [ IF EXISTS ] <policy_name>

Access Control Requirements

PrivilegeDescription
APPLY MASKING POLICYRequired to drop a masking policy unless you own that policy.

You must have the global APPLY MASKING 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

CREATE MASKING POLICY email_mask AS (val string) RETURNS string -> CASE WHEN current_role() IN ('MANAGERS') THEN val ELSE '*********' END COMMENT = 'hide_email'; DROP MASKING POLICY email_mask;

Was this page helpful?