GRANT (Role)
Assigns roles to users or other roles.
Note: Granting a role does not activate the role automatically; you must enable it with SET ROLE command.
Syntax
GRANT role[,…] TO grantee[,…] [ WITH ADMIN OPTION ]
Parameters
role |
A role to grant. |
| grantee |
Designates users to be granted the specified roles, one of the following: |
WITH ADMIN OPTION
|
Gives grantee the privilege to grant the same role to other users or roles. For details, see How to Grant Privileges in the Administrator's Guide. |
Privileges
One of the following:
- Superuser
- Role grantee who was given
WITH ADMIN OPTION
Examples
See Granting Access to Database Roles in the Administrator's Guide.