ALTER ROLE - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

ALTER ROLE

Renames a role or changes the owner. For a list of Amazon Redshift system-defined roles, see Amazon Redshift system-defined roles.

Required permissions

Following are the required permissions for ALTER ROLE:

  • Superuser

  • Users with the ALTER ROLE permissions

Syntax

ALTER ROLE role [ WITH ] { { RENAME TO role } | { OWNER TO user_name } }[, ...] [ EXTERNALID TO external_id ]

Parameters

role

The name of the role to be altered.

RENAME TO

A new name for the role.

OWNER TO user_name

A new owner for the role.

EXTERNALID TO external_id

A new external ID 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 changes the name of a role from sample_role1 to sample_role2.

ALTER ROLE sample_role1 WITH RENAME TO sample_role2;

The following example changes the owner of the role.

ALTER ROLE sample_role1 WITH OWNER TO user1

The syntax of the ALTER ROLE is similar to ALTER PROCEDURE following.

ALTER PROCEDURE first_quarter_revenue(bigint, numeric) RENAME TO quarterly_revenue;

The following example changes the owner of a procedure to etl_user.

ALTER PROCEDURE quarterly_revenue(bigint, numeric) OWNER TO etl_user;

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

ALTER ROLE sample_role1 EXTERNALID TO "XYZ456";