There is user 'test_user1'. SET ROLE Command:
SET ROLE test_user1
returns error:
ERROR: permission denied to set role "test_user2"
I couldn't find how to grant permission for SET ROLE.
Thanks in advance.
Error message
ERROR: permission denied to set role "test_user2"
implies that the command was
test_user1> SET ROLE test_user2;
, but not SET ROLE test_user1
as you wrote.
If you are trying to set role test_user2 for the user test_user1, grant it:
test_user2> grant test_user2 to test_user1;