RENAME ROLE

RENAME ROLE can be used to rename a role.

Learn more about the permission system in the access control guide.

Permissions

The role must have the SUPERUSER permission.

Syntax

alter_role_rename_role_statement ::=
    ALTER ROLE role_name RENAME TO new_name
    ;

role_name ::= identifier

new_name ::= identifier

Parameters

Parameter

Description

role_name

The role name to apply the change to

new_name

The new role name

Notes

  • Role names are unique across the cluster.

  • SQream recommend that role names should follow these rules:

    • Are case-insensitive

    • Start with either a letter or underscore

    • Contain only ASCII letters, numbers, or underscores

    • Follow rules for Identifiers and Keywords

Examples

Renaming a role

ALTER ROLE rhendricks RENAME TO patches;