SET ROLE
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Statements for MariaDB Xpand
Topics on this page:
Overview
In 23.09, 6.1:
Activates the role for the current user's session.
In 6.1:
Activates the role for the current user's session.
In 6.0, 5.3:
Not present
See also: SQL Statements for MariaDB Xpand 23.09, in 6.1, in 6.0, and in 5.3
See also: SQL Statements for MariaDB Xpand 6.1
USAGE
Common Syntax:
SET ROLE {ALL | NONE | <role_name> [, <role_name>] ...}
DETAILS
This statement activates the role for the current user's session.
For Xpand, all objects are case-insensitive.
EXAMPLES
SET ROLE
To activate a role for the current user:
SET ROLE role1;
To check the current role for a user:
SELECT CURRENT_ROLE();
+----------------+
| CURRENT_ROLE() |
+----------------+
| role1 |
+----------------+
SET ROLE ALL
To activate all roles granted to a user:
SET ROLE ALL;
SELECT CURRENT_ROLE();
+---------------------+
| CURRENT_ROLE() |
+---------------------+
| role1, role2, role3 |
+---------------------+
SET ROLE NONE
To deactivate all roles granted to a user:
SET ROLE NONE;
SELECT CURRENT_ROLE();
+----------------+
| CURRENT_ROLE() |
+----------------+
| |
+----------------+
RELATED TOPICS
CHANGE HISTORY
Release Series | History |
---|---|
23.09 |
|
6.1 |
|
6.0 |
|
5.3 |
|
Release Series | History |
---|---|
6.1 |
|