DROP PSEUDONYMISATION RULE

Removes a pseudonymisation rule from a table.

Category: pseudonymisationDeltaForge extension

Syntax

DROP PSEUDONYMISATION RULE [IF EXISTS] ON <table> [(<column_pattern>)]

Description

## Overview DROP PSEUDONYMISATION RULE permanently removes one or all pseudonymisation rules from a table. Once dropped, subsequent SELECT queries against the affected columns will return the original unprotected values. The underlying data on disk is not modified because pseudonymisation rules operate at query time only. Dropping a rule does not affect historical query results or Delta log time travel snapshots. This command supports incremental policy adjustment. For example, after a regulatory review determines that a column no longer requires protection, the corresponding rule can be removed without altering any other rules on the same table. ## Behavior - When a column_pattern is provided, only the rule matching that exact pattern string on the specified table is removed. When column_pattern is omitted, all rules on the table are removed in a single operation. - The command deletes from the catalog via the CatalogRouter when available, and also removes the rule from the session-scoped in-memory store. The response message reports the number of rules removed. - After removal, the executor sets the needs_catalog_sync flag to trigger re-registration of the affected table. The TableProvider wrapping is updated so the removed column(s) revert to returning raw stored values. - If no matching rules are found for the specified table and column pattern, the command succeeds with a message indicating that zero rules were removed. It does not raise an error. - The command is not transactional across the catalog and memory stores. If the catalog deletion succeeds but the memory removal encounters an inconsistency, the catalog state takes precedence on the next session. ## Compatibility DROP PSEUDONYMISATION RULE supports GDPR right-to-be-forgotten workflows where data protection rules must be adjusted as retention policies evolve. Removing a rule restores full data visibility to all users with SELECT access to the underlying table.

Parameters

NameTypeDescription
table_nameSpecify the fully qualified table name in zone.schema.table format. The name is matched case-insensitively against stored rules.
column_patternSpecify the column pattern of the rule to remove. Provide the pattern in parentheses after the table name. When omitted, all pseudonymisation rules on the target table are removed.

Examples

DROP PSEUDONYMISATION RULE ON medical.patients (patient_name);
DROP PSEUDONYMISATION RULE ON hr.employees;  -- removes all rules
DROP PSEUDONYMISATION RULE ON insurance.claims (description);
DROP PSEUDONYMISATION RULE ON finance.accounts (*_ssn);
DROP PSEUDONYMISATION RULE ON clinical.trial_participants (email);
DROP PSEUDONYMISATION RULE ON edi.hipaa_claims (bpr_8);

See Also

Open in interactive docs →   DeltaForge home →