Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql: How to grant permission for set role?

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.

like image 529
Iuliia Avatar asked Dec 18 '22 22:12

Iuliia


1 Answers

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;
like image 79
Egor Rogov Avatar answered Jan 06 '23 23:01

Egor Rogov