BEGIN; CREATE EXTENSION IF NOT EXISTS anon CASCADE; NOTICE: installing required extension "tsm_system_rows" NOTICE: installing required extension "ddlx" CREATE TABLE employee ( firstname TEXT, lastname TEXT, phone TEXT, zipcode INTEGER ); INSERT INTO employee VALUES ('Sarah','Connor','0609110911'); SELECT * FROM employee; firstname | lastname | phone | zipcode -----------+----------+------------+--------- Sarah | Connor | 0609110911 | (1 row) SECURITY LABEL FOR anon ON COLUMN employee.firstname IS 'MASKED WITH VALUE ''XXXX'' '; SECURITY LABEL FOR anon ON COLUMN employee.lastname IS 'MASKED WITH VALUE $$REDACTED$$ '; SECURITY LABEL FOR anon ON COLUMN employee.phone IS 'MASKED WITH VALUE NULL '; COMMENT ON COLUMN employee.zipcode IS 'MASKED WITH VALUE 100'; SELECT anon.anonymize_table('employee'); anonymize_table ----------------- t (1 row) SELECT count(*)=1 FROM anon.pg_masking_rules WHERE masking_filter = '$$REDACTED$$'; ?column? ---------- t (1 row) SELECT count(*)=1 FROM anon.pg_masking_rules WHERE masking_filter = 'NULL'; ?column? ---------- t (1 row) SELECT count(*)=1 FROM anon.pg_masking_rules WHERE masking_filter = '100'; ?column? ---------- t (1 row) ROLLBACK;