> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DROP ROLE

The `DROP ROLE` [statement](https://docs.cockroachlabs.com/docs/v24.2/sql-statements) removes one or more SQL roles. You can use the keywords `ROLE` and `USER` interchangeably. [`DROP USER`](https://docs.cockroachlabs.com/docs/v24.2/drop-user) is an alias for `DROP ROLE`.

> [!NOTE]
>
> The `DROP ROLE` statement performs a schema change. For more information about how online schema changes work in CockroachDB, see [Online Schema Changes](https://docs.cockroachlabs.com/docs/v24.2/online-schema-changes).

## Considerations

* The `admin` user/role cannot be dropped, and `root` must always be a member of `admin`.
* A user/role cannot be dropped if it has privileges. Use [`REVOKE`](https://docs.cockroachlabs.com/docs/v24.2/revoke) to remove privileges.
* Users/roles that [own objects](https://docs.cockroachlabs.com/docs/v24.2/security-reference/authorization#object-ownership) (such as databases, tables, schemas, and types) cannot be dropped until the [ownership is transferred to another user/role](https://docs.cockroachlabs.com/docs/v24.2/alter-database).
* If a user/role is logged in while a [different session](https://docs.cockroachlabs.com/docs/v24.2/show-sessions) drops that user, CockroachDB checks that the user exists before allowing it to inherit privileges from [the `public` role](https://docs.cockroachlabs.com/docs/v24.2/security-reference/authorization). In addition, any active [web](https://docs.cockroachlabs.com/docs/v24.2/ui-overview#authentication) [sessions](https://docs.cockroachlabs.com/docs/v24.2/cockroach-auth-session) are revoked when a user is dropped.

## 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 [`CREATEROLE`](https://docs.cockroachlabs.com/docs/v24.2/create-role#create-a-role-that-can-create-other-roles-and-manage-authentication-methods-for-the-new-roles) parameter set.

## Synopsis

![drop\_role syntax diagram](https://mintcdn.com/cockroachlabs/UZNSFbmU2EwEm6G5/images/sql-diagrams/common/drop_role.svg?fit=max\&auto=format\&n=UZNSFbmU2EwEm6G5\&q=85\&s=148776e9eceff54cb9395e437d9c8b7c)

## Parameters

| Parameter | Description |
| - | - |
| `name` | The name of the role to remove. To remove multiple roles, use a comma-separate list of roles. You can use [`SHOW ROLES`](https://docs.cockroachlabs.com/docs/v24.2/show-roles) 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.

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW GRANTS ON documents FOR dev_ops;
```

```
+------------+--------+-----------+---------+------------+
|  Database  | Schema |   Table   |  User   | Privileges |
+------------+--------+-----------+---------+------------+
| jsonb_test | public | documents | dev_ops | INSERT     |
+------------+--------+-----------+---------+------------+
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> REVOKE INSERT ON documents FROM dev_ops;
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> DROP ROLE dev_ops;
```

## See also

* [Authorization](https://docs.cockroachlabs.com/docs/v24.2/authorization)
* [Authorization Best Practices](https://docs.cockroachlabs.com/docs/v24.2/security-reference/authorization#authorization-best-practices)
* [`CREATE ROLE`](https://docs.cockroachlabs.com/docs/v24.2/create-role)
* [`SHOW ROLES`](https://docs.cockroachlabs.com/docs/v24.2/show-roles)
* [`GRANT`](https://docs.cockroachlabs.com/docs/v24.2/grant)
* [`SHOW GRANTS`](https://docs.cockroachlabs.com/docs/v24.2/show-grants)
* [SQL Statements](https://docs.cockroachlabs.com/docs/v24.2/sql-statements)
* [Online Schema Changes](https://docs.cockroachlabs.com/docs/v24.2/online-schema-changes)
