Skip to content

anon.anonymize_table() will not act on multiple masking rules applied to different columns within the table

SECURITY LABEL FOR anon ON COLUMN users.last_name IS 'MASKED WITH FUNCTION anon.fake_last_name()';
SECURITY LABEL FOR anon ON COLUMN users.first_name IS 'MASKED WITH FUNCTION anon.fake_first_name()';
SECURITY LABEL FOR anon ON COLUMN users.name IS 'MASKED WITH FUNCTION anon.fake_first_name() || '' '' || anon.fake_last_name()';
SECURITY LABEL FOR anon ON COLUMN users.email IS 'MASKED WITH FUNCTION anon.random_string(24)';

When I then run SELECT anon.anonymize_table('users') I'm only seeing the data change on one of these columns, in this case first_name. If I run SELECT anon.anonymize_column('users','<column>') I can update each column individually, but I was hoping that running anonymize_table() would alter all columns with an attached security label.

Edited by Joe Auty
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information