Purpose
This statement is used to drop a role.
Note
After a role is dropped, the following actions are performed:
- The role is revoked from all users and roles that have been granted the role.
- The role is removed from the database.
- Existing sessions that have the role enabled are not affected.
- New sessions cannot enable the role.
Syntax
DROP ROLE role_name
Parameters
| Parameter | Description |
|---|---|
| role_name | The name of the role to be dropped. |
Examples
First, create a role named sales_manager, and then drop it.
obclient> CREATE ROLE sales_manager;
obclient> DROP ROLE sales_manager;