CREATE ROLE - Amazon Redshift

CREATE ROLE

Creates a new custom role that is a collection of privileges.

Required privileges

Following are the required privileges for CREATE ROLE.

  • Superuser

  • Users with the CREATE ROLE privilege

Syntax

CREATE ROLE role_name [ EXTERNALID external_id ]

Parameters

role_name

The name of the role. The role name must be unique and can't be the same as any user names. A role name can't be a reserved word.

A superuser or regular user with the CREATE ROLE privilege can create roles. A user that is not a superuser but that has been granted USAGE to the role WITH GRANT OPTION and ALTER privilege can grant this role to anyone.

EXTERNALID external_id

The identifier for the role, which is associated with an identity provider. For more information, see Native identity provider (IdP) federation for Amazon Redshift.

Examples

The following example creates a role sample_role1.

CREATE ROLE sample_role1;

The following example creates a role sample_role1, with an external ID that is associated with an identity provider.

CREATE ROLE sample_role1 EXTERNALID "ABC123";