-- This test cannot be run in a single transaction -- This test must be run on a database named 'contrib_regression' CREATE EXTENSION IF NOT EXISTS anon CASCADE; NOTICE: installing required extension "tsm_system_rows" NOTICE: installing required extension "pgcrypto" -- INIT SELECT anon.start_dynamic_masking('public','foo'); start_dynamic_masking ----------------------- t (1 row) CREATE ROLE skynet LOGIN; SECURITY LABEL FOR anon ON ROLE skynet IS 'MASKED'; SELECT anon.mask_update(); mask_update ------------- t (1 row) -- search_path must be 'foo,public' \! psql contrib_regression -U skynet -c 'SHOW search_path;' search_path ------------- foo, public (1 row) CREATE ROLE hal LOGIN; COMMENT ON ROLE hal IS 'MASKED'; SELECT anon.mask_update(); mask_update ------------- t (1 row) -- search_path must be 'foo,public' \! psql contrib_regression -U hal -c 'SHOW search_path;' search_path ------------- foo, public (1 row) -- STOP SELECT anon.stop_dynamic_masking(); NOTICE: The previous priviledges of 'skynet' are not restored. You need to grant them manually. NOTICE: The previous priviledges of 'hal' are not restored. You need to grant them manually. stop_dynamic_masking ---------------------- t (1 row) -- CLEAN DROP EXTENSION anon CASCADE; DROP EXTENSION tsm_system_rows; DROP EXTENSION pgcrypto; REASSIGN OWNED BY skynet TO postgres; DROP OWNED BY skynet CASCADE; DROP ROLE skynet; REASSIGN OWNED BY hal TO postgres; DROP OWNED BY hal CASCADE; DROP ROLE hal;