ALTER ROLE

Synopsis

The ALTER ROLE statement changes the properties of an existing role.It allows modifying properties SUPERUSER, PASSWORD, and LOGIN.

This statement is enabled by setting the YB-TServer configuration option use_cassandra_authentication to true.

Syntax

Diagram

ALTER ROLE - 图1

Grammar

  1. alter_table ::= ALTER ROLE role_name WITH role_property [ AND role_property ...];
  2. role_property ::= PASSWORD = '<Text Literal>'
  3. | LOGIN = <Boolean Literal>'
  4. | SUPERUSER = '<Boolean Literal>'

Where

  • role_name is a text identifier.

Semantics

  • An error is raised if role_name does not exist.

Examples

You can do this as shown below.

  1. cqlsh:example> CREATE ROLE finance;
  1. cqlsh:example> ALTER ROLE finance with LOGIN = true;
  1. cqlsh:example> ALTER ROLE finance with SUPERUSER = true;
  1. cqlsh:example> ALTER ROLE finance with PASSWORD = 'jsfp9ajhufans2' AND SUPERUSER = false;

See also