ALTER ROLE
This page documents a preview version.
v2.23 Preview
Preview includes features under active development and is for development and testing only.
For production, use the latest stable version (v2024.1).
For production, use the latest stable version (v2024.1).
Synopsis
Use the ALTER ROLE
statement to change the properties of an existing role.
It allows modifying properties SUPERUSER
, PASSWORD
, and LOGIN
.
This statement is enabled by setting the YB-TServer flag --use_cassandra_authentication
to true
.
Syntax
Diagram
Grammar
alter_table ::= ALTER ROLE role_name WITH role_property [ AND role_property ...];
role_property ::= PASSWORD = '<Text Literal>'
| LOGIN = <Boolean Literal>'
| SUPERUSER = '<Boolean Literal>'
Where
role_name
is a text identifier.
Semantics
An error is raised if role_name
does not exist.
Examples
ycqlsh:example> CREATE ROLE finance;
ycqlsh:example> ALTER ROLE finance with LOGIN = true;
ycqlsh:example> ALTER ROLE finance with SUPERUSER = true;
ycqlsh:example> ALTER ROLE finance with PASSWORD = 'jsfp9ajhufans2' AND SUPERUSER = false;