Skip to main content
The DROP ROLE removes one or more SQL roles. You can use the keywords ROLE and USER interchangeably. is an alias for DROP ROLE.
The “ statement performs a schema change. For more information about how online schema changes work in CockroachDB, see .

Considerations

  • The admin role cannot be dropped, and root must always be a member of admin.
  • A role cannot be dropped if it has privileges. Use to remove privileges.
  • Roles that (such as databases, tables, schemas, and types) cannot be dropped until the .

Required privileges

Non-admin roles cannot drop admin roles. To drop non-admin roles, the role must be a member of the admin role or have the parameter set.

Synopsis

drop_role syntax diagram

Parameters

ParameterDescription
nameThe name of the role to remove. To remove multiple roles, use a comma-separate list of roles.

You can use to find the names of roles.

Example

In this example, first check a role’s privileges. Then, revoke the role’s privileges and remove the role.

See also