pg_diffix
pg_diffix · Provides strong dynamic anonymization for PostgreSQL query results.
Overview
PostgreSQL · 13, 14, 15, 16, 17, 18
Usage
Sources:
pg_diffix implements dynamic query anonymization for PostgreSQL. Administrators label tables as public or personal, identify one or more anonymizing-ID columns, and assign roles the direct, anonymized_trusted, or anonymized_untrusted access level. Queries against personal tables are then restricted and aggregate results receive suppression and noise.
Minimal administration outline
Reconnect after setting the preload library, then inspect the active access level and issue an allowed grouped query:
The anonymized modes intentionally allow only a limited SQL subset. Correct privacy depends on complete table/column labels, sound anonymizing IDs, appropriate suppression settings, role isolation, and review of RLS policies, user-defined functions, and every other installed extension. A role labeled direct bypasses anonymization.
The administrator guide explicitly calls the Fir generation a work in progress, and PostgreSQL 13 or later is required. The control file and catalog use the nonnumeric version fir, while META.json at the same commit reports distribution version 1.2.0; do not treat those labels as an upgrade sequence. Deploy only after a privacy review and adversarial testing against the actual schema and workload.