Skip to content

ON ROLE

Syntax

GRANT { { ALTER ROLE | DROP ROLE | CONTROL }
   [, ...] | ALL [ PRIVILEGES ] }
   ON ROLE role_specification [, ...]
   TO role_specification [, ...] [ WITH GRANT OPTION ]

Parameters

ALTER ROLE
Privilege to make other users and roles members of the specified role and to change passwords and password policies for the role. Only superusers can alter other superusers.
DROP ROLE
Privilege to drop the specified role. Only superusers can drop other superusers.
CONTROL
All privileges on the specified role, including any privileges that may be defined as GRANT privileges on roles in future releases. You cannot revoke individual ON ROLE privileges from a user with CONTROL, and CONTROL is not part of ALL.

See also HAS_ROLE_PRIVILEGE and the separate GRANT ROLE command.

Example

Grant CONTROL privilege on four users to role bar:

premdb=# grant control on role backup1, backup2, restore1, restore2 to bar;
GRANT

Parent topic:GRANT