ParadeDB’s gdpr_purge() function deletes or anonymizes personal data across related tables to meet GDPR right-to-erasure requirements.
gdpr_purge() automates GDPR "right to be forgotten" workflows by deleting or anonymizing a subject’s personal data in one call, following foreign-key paths and optional archive rules.
Call it with target table, key column, and options that decide whether rows are removed, anonymized, archived, and cascaded to child tables.
archive keeps a ZIP of purged rows in paradedb.gdpr_archive; anonymize replaces PII with hashed values; cascade follows foreign keys from the starting row into related tables like Orders and OrderItems.
Pass dry_run => true to get a JSON plan showing which tables and row counts will change, letting compliance teams sign off before execution.
Set log => true (default) to store a signed digest of every purge in paradedb.gdpr_log. These immutable entries give auditors proof of erasure.
Delete breaks historical metrics. anonymize scrubs names and emails but keeps ids, letting analytics continue while meeting GDPR.
Create a composite index on Customers(id) and Orders(customer_id) so cascade runs quickly. Schedule nightly purges for accumulated requests.
Run gdpr_purge() inside a BEGIN…ROLLBACK block in staging. Compare counts before and after with pg_stat_user_tables.
If archive was true, INSERT archived rows back; otherwise restore from backup—there’s no built-in undo for permanent deletions.
Yes. The function detects partition parents and issues targeted DELETEs or UPDATEs inside each partition, preserving performance.
Call gdpr_purge() in a loop or write SELECT gdpr_purge(...) FROM unnest(array[...]) to bulk-process request IDs.
GDPR recommends encryption at rest, but gdpr_purge() focuses on erasure. Use pgcrypto or Transparent Data Encryption for full compliance.