DROP ROLE
This page documents the preview version (v2.21). Preview includes features under active development and is for development and testing only. For production, use the stable version (v2024.1). To learn more, see Versioning.
Synopsis
Use the DROP ROLE statement to delete an existing role.
This statement is enabled by setting the YB-TServer flag use_cassandra_authentication to true.
Syntax
Diagram
drop_role
Grammar
drop_role ::= DROP ROLE [ IF EXISTS ] role_name
Where
role_nameis a text identifier.
Semantics
- An error is raised if
role_namedoes not exist unless IF EXISTS option is present. - Only a role with the
SUPERUSERstatus can delete anotherSUPERUSERrole. - Only a client with the permission
DROPonALL ROLESor on the specifiedrole_name, or with theSUPERUSERstatus can delete another role.
Examples
ycqlsh:example> DROP ROLE role1;
ycqlsh:example> DROP ROLE IF EXISTS role2;