CREATE ROLE
Descriptionβ
The CREATE ROLE
statement is used to create an unprivileged role, which can be subsequently granted with the GRANT command.
Syntaxβ
CREATE ROLE <role_name> [<comment>];
Required Parametersβ
1. <role_name>
The name of the role.
Optional Parametersβ
1. <comment>
The comment of the role.
Access Control Requirementsβ
The user executing this SQL command must have at least the following privileges:
Privilege | Object | Notes |
---|---|---|
ADMIN_PRIV | USER or ROLE | This operation can only be performed by users or roles with ADMIN_PRIV permissions |
Exampleβ
- Create a role
CREATE ROLE role1;
- Create a role with comment
CREATE ROLE role2 COMMENT "this is my first role";