DROP ROLE

Synopsis

The DROP ROLE deletes an existing role.

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

Syntax

Diagram

drop_role

DROP ROLE - 图1

Grammar

  1. drop_role ::= DROP ROLE [ IF EXISTS ] role_name

Where

  • role_name is a text identifier.

Semantics

  • An error is raised if role_name does not exist unless IF EXISTS option is present.
  • Only a role with the SUPERUSER status can delete another SUPERUSER role.
  • Only a client with the permission DROP on ALL ROLES or on the specified role_name, or with the SUPERUSER status can delete another role.

Examples

You can do this as shown below.

  1. cqlsh:example> DROP ROLE role1;
  1. cqlsh:example> DROP ROLE IF EXISTS role2;

See also