postgres alter role for user code example
Example 1: postgresql change user role grant
=# ALTER USER librarian WITH SUPERUSER;
ALTER ROLE
Example 2: change role postgres
# make 'dave' superuser and allow him to create databases
ALTER ROLE dave WITH SUPERUSER;
ALTER ROLE dave WITH CREATEDB;