ALTER ROLE
Changes password for a role. Allows superuser, login, and other role options to be set.
Synopsis
ALTER ROLE <role_name>
( WITH PASSWORD = '<role_password>' )
[ [ WITH | AND ] LOGIN = ( true | false ) ]
[ [ WITH | AND ] SUPERUSER = ( true | false ) ]
[ [ WITH | AND ] OPTIONS = { <custom_options_map> } ] ;
| Syntax conventions | Description |
|---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
|
Variable value. Replace with a user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
|
Set, list, map, or tuple.
Angle brackets ( |
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrConfig files. |
Options
| Options | Description | Default |
|---|---|---|
|
Identifier of the role to alter. CQL forces all names to lowercase. If the name contains uppercase letters or special characters, enclose the role name in quotes. |
|
|
Change the password for the role. Enclose the password in single quotes. Superusers (and roles with appropriate |
|
|
Optional.
Enable or disable |
false |
|
Optional.
Enable or disable |
false |
|
Optional. Change or add a map of custom options. Reserved for use with authentication plug-ins. Refer to the authenticator documentation for details. |
Example
- Change the password for a role
-
A role can change the password for itself or another role that it has permission to modify. A superuser can change the password of any role.
Use
ALTERto change a role’s password:ALTER ROLE sandy WITH PASSWORD = 'bestTeam'; - Alter a role to enable
SUPERUSERstatus -
ALTER ROLE sandy WITH SUPERUSER=true; - Alter a role to enable
LOGINprivileges -
ALTER ROLE team_manager WITH LOGIN=true;