grant role to user postgres code example
Example 1: postgresql change user role grant
=# ALTER USER librarian WITH SUPERUSER;
ALTER ROLE
Example 2: how to add user to role postgresql
CREATE ROLE joe LOGIN INHERIT;
CREATE ROLE admin NOINHERIT;
CREATE ROLE wheel NOINHERIT;
GRANT admin TO joe;
GRANT wheel TO admin;
Example 3: postgresql change user role grant
=# ALTER USER role_specification WITH OPTION1 OPTION2 OPTION3;