Thanks. You suggestion helped me to find a solution! DECLARE ... query text; BEGIN .... query := query :='SET SESSION ROLE ' || wishedrole; EXECUTE query; ......
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных