- User & Security DDL (Roles)
Modifies the properties for an existing role. Currently, the only supported operations are renaming a role or adding/overwriting/removing a comment for a role.
ALTER ROLE [ IF EXISTS ] <name> RENAME TO <new_name> ALTER ROLE [ IF EXISTS ] <name> SET COMMENT = '<string_literal>' ALTER ROLE [ IF EXISTS ] <name> UNSET COMMENT
- Specifies the identifier for the role to alter. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
RENAME TO new_name
Specifies the new identifier for the role; must be unique for your account.
For more details, see Identifier Syntax.
Specifies the properties to set for the role:
COMMENT = 'string_literal'
- Adds a comment or overwrites an existing comment for the role.
Specifies the properties to unset for the role, which resets them to the defaults.
Currently, the only property you can unset is
COMMENT, which removes the comment, if one exists, for the role.
- To rename a role (using the
RENAME TO new_nameparameter), you must be the role owner (i.e. the role with the OWNERSHIP privilege on the role you are renaming). In addition, this action requires a role with the CREATE ROLE privilege on the account.
ALTER ROLE role1 RENAME TO role2;
Add a comment for role
ALTER ROLE myrole SET COMMENT = 'New comment for role';