DROP USER removes one or more SQL users. You can use the keywords ROLE and USER interchangeably. DROP USER is an alias for .
The DROP USER statement performs a schema change. For more information about how online schema changes work in CockroachDB, see .
Considerations
- The
adminuser/role cannot be dropped, androotmust always be a member ofadmin. - A user/role cannot be dropped if it has privileges. Use to remove privileges.
- Users/roles that (such as databases, tables, schemas, and types) cannot be dropped until the .
- If a user/role is logged in while a drops that user, CockroachDB checks that the user exists before allowing it to inherit privileges from . In addition, any active are revoked when a user is dropped.
Required privileges
Non-admin users cannot drop admin users. To drop non-admin users, the user must be a member of theadmin role or have the parameter set.
Synopsis
See .Parameters
| Parameter | Description |
|---|---|
user\_name | The name of the user to remove. To remove multiple users, use a comma-separate list of usernames. You can use to find usernames. |

