create user postgres role grant create db code example
Example 1: 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 2: postgresql change user role grant
=# ALTER USER role_specification WITH OPTION1 OPTION2 OPTION3;