CREATE ROLE v10
CREATE ROLE -- define a new database role.
CREATE ROLE adds a new role to the Advanced Server database cluster. A role is an entity that can own database objects and have database privileges; a role can be considered a “user”, a “group”, or both depending on how it is used. The newly created role does not have the
LOGIN attribute, so it cannot be used to start a session. Use the
ALTER ROLE command to give the role
LOGIN rights. You must have
CREATEROLE privilege or be a database superuser to use the
CREATE ROLE command.
IDENTIFIED BY clause is specified, the
CREATE ROLE command also creates a schema owned by, and with the same name as the newly created role.
The roles are defined at the database cluster level, and so are valid in all databases in the cluster.
The name of the new role.
IDENTIFIED BY password
Sets the role’s password. (A password is only of use for roles having the
LOGIN attribute, but you can nonetheless define one for roles without it.) If you do not plan to use password authentication you can omit this option.
ALTER ROLE to change the attributes of a role, and
DROP ROLE to remove a role. The attributes specified by
CREATE ROLE can be modified by later
ALTER ROLE commands.
REVOKE to add and remove members of roles that are being used as groups.
The maximum length limit for role name and password is
Create a role (and a schema) named,
admins, with a password: