gdpr_anatomizer
postgresql_anatomy · Prototype GDPR/anatomy anonymization extension implemented with PL/Python and PL/pgSQL helpers.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100676 | gdpr_anatomizer | postgresql_anatomy | 0.0.1 | SEC | Unknown | Python |
PostgreSQL · 12
| Relationships | |
|---|---|
| Requires | plpython3u |
Usage
Sources:
gdpr_anatomizer is a research prototype implementing the Anatomy privacy-publication algorithm with PL/Python. It separates quasi-identifiers from a sensitive attribute into linked tables. Upstream explicitly describes it as inefficient for large data and intended for learning and debugging; it does not itself establish GDPR compliance or a privacy guarantee.
Core Workflow
The extension requires the untrusted plpython3u language. Inspect its installation SQL before use: installation calls initialization functions that drop and recreate unqualified example and similarity tables. Run it only in a disposable database, then analyze a copied dataset and generate anatomy tables:
The default output names are qi_table and sa_table. Verify the generated equivalence classes and whether suppression meets the application’s threat model before exposing any result.
Important Objects
analyze_datasetreports the sensitive-value distribution and candidate diversity levels.anatomyconstructs the quasi-identifier and sensitive-attribute tables; arguments also control schema, output names, and reference columns.apply_sa_tagandremove_sa_tagsmanage tags used for sensitive attributes.set_del_eq_class_triggerinstalls deletion handling for equivalence classes.init_csv_datasetperforms a server-side file import and recreates a demonstration table.
Security and Data-Safety Notes
PL/Python is untrusted and its code runs with database-server process capabilities. This prototype loads much of the dataset into memory, uses randomized grouping, and builds dynamic SQL by string formatting, so untrusted identifiers or values can cause SQL injection. Several helpers drop or create fixed, unqualified tables, and init_csv_dataset reads a server-local path. Use a restricted disposable database, inspect every generated table, and never treat the output as independently validated anonymization.