2.x: still no way to use gen_random_uuid in anonymization masks out of the box
After #426 (closed) and based on https://gitlab.com/dalibo/postgresql_anonymizer/-/blob/0b58dc149230f24313a81ab754683faadb0f4d9d/sql/anon.sql#L65, it looks like the gen_random_uuid should be usable out of the box in anonymization masks.
However, that didn't seem to work at all for me, either using MASKED WITH FUNCTION gen_random_uuid() or MASKED WITH FUNCTION pg_catalog.gen_random_uuid() or MASKED WITH FUNCTION anon.gen_random_uuid().
I had to explicitly add pg_catalog.gen_random_uuid as TRUSTED and use it with pg_catalog.gen_random_uuid in anonymization masks, only then it worked:
SECURITY LABEL FOR anon ON FUNCTION pg_catalog.gen_random_uuid IS 'TRUSTED';
... IS 'MASKED WITH FUNCTION pg_catalog.gen_random_uuid()';
Edited by José Pedro Saraiva