postgres add user to role 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: how to add user to role postgresql
GRANT group_role TO role1, ... ;
REVOKE group_role FROM role1, ... ;
Example 3: postgresql create user roles
CREATE ROLE name [ WITH ADMIN role_name ]