YMatrix
Cluster Deployment
Data Model
Data Writing
Data Query
SQL Reference
Maintenance and Monitoring
Tool Guide
Troubleshooting
Delete the database role.
DROP ROLE [IF EXISTS] name [, ...]
DROP ROLE Deletes the specified role. To delete the Super User role, you must be a Super User yourself. To remove a non-superuser role, you must have CREATEROLE privileges.
If the role is still referenced in any database, the role cannot be deleted; if so, an error will be raised. Before deleting a role, you must delete all objects it owns (or reassign its ownership) and revoke all privileges that have been granted to the role on other objects. The REASSIGN OWNED and DROP OWNED commands can be used for this purpose.
However, it is not necessary to delete the role membership involving the role; DROP ROLE automatically revokes all memberships of the target role in other roles and other roles in the target role. Other characters will not be lost and will not be affected by other things.
IF EXISTS
name
Delete the roles named sally and bob:
DROP ROLE sally, bob;
The SQL standard defines DROP ROLE, but only allows deletion of one role at a time, and the privilege requirements it specifies are different from those used by the YMatrix database.