This page is part of MariaDB's MariaDB Documentation.
The parent of this page is: SQL Statements for MariaDB Xpand
Topics on this page:
Deletes a role.
In 6.0, 5.3:
See also: SQL Statements for MariaDB Xpand 6.1, in 6.0, and in 5.3
See also: SQL Statements for MariaDB Xpand 6.0 and in 5.3
See also: SQL Statements for MariaDB Xpand 6.1
DROP ROLE [IF EXISTS] <role_name> [, <role_name>] ...
DROP ROLE statement irreversibly deletes the role. If any users are granted the role, the grant will be revoked.
For Xpand, all objects are case-insensitive.
To delete a role:
DROP ROLE role1;
By default, if you try to delete a role that does not exist, an error is raised.
To prevent an error when the specified role is not present, add the
IF EXISTS clause:
DROP ROLE IF EXISTS role1;
If the specified role exists, it will be deleted. If the specified role does not exist, the query does not raise an error.