You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
291 B
Plaintext
12 lines
291 B
Plaintext
-- Create a new role
|
|
CREATE ROLE role_name;
|
|
|
|
-- Create a new role with a username and password:
|
|
CREATE ROLE username NOINHERIT LOGIN PASSWORD password;
|
|
|
|
-- Change role for current sesion to the new_role:
|
|
SET ROLE new_role;
|
|
|
|
-- Allow role_1 to set its role as role_2:
|
|
GRANT role_2 TO role_1;
|