2.x: anon.privacy_by_default setting is not affected by ALTER DATABASE foo SET ...

The documentation mentions that:

ALTER DATABASE foo SET anon.privacy_by_default = True;

Is the correct way to enable the privacy_by_default feature and this has worked fine with 1.x. However, with 2.x it seems this method doesn't do anything anymore and one must use set_config:

SELECT * FROM pg_settings WHERE name = 'anon.privacy_by_default';
DO $$
BEGIN
   EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) || ' SET anon.privacy_by_default = True';
END
$$;
SELECT * FROM pg_settings WHERE name = 'anon.privacy_by_default';

SELECT set_config('anon.privacy_by_default', 'on', false);
SELECT * FROM pg_settings WHERE name = 'anon.privacy_by_default';

anon.privacy_by_default|off||Customized Options|Mask all columns with NULL (or the default value for NOT NULL columns)||superuser|bool|default||||off|off|||f
anon.privacy_by_default|off||Customized Options|Mask all columns with NULL (or the default value for NOT NULL columns)||superuser|bool|default||||off|off|||f
on
anon.privacy_by_default|on||Customized Options|Mask all columns with NULL (or the default value for NOT NULL columns)||superuser|bool|session||||off|off|||f

Is this a documentation problem with the new version or a bug? 😄

Thanks again!

Edited by José Pedro Saraiva
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information