8.6. CREATE ROLE

Synopsis

  1. CREATE ROLE role_name
  2. [ WITH ADMIN ( user | USER user | ROLE role | CURRENT_USER | CURRENT_ROLE ) ]

Description

CREATE ROLE creates the specified role in the current catalog.

The optional WITH ADMIN clause causes the role to be created withthe specified user as a role admin. A role admin has permission to dropor grant a role. If the optional WITH ADMIN clause is notspecified, the role is created with current user as admin.

Examples

Create role admin

  1. CREATE ROLE admin;

Create role moderator with admin bob:

  1. CREATE ROLE moderator WITH ADMIN USER bob;

Limitations

Some connectors do not support role management.See connector documentation for more details.

See Also

DROP ROLE, SET ROLE, GRANT ROLES, REVOKE ROLES