SET ROLE

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

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.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

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() |
+----------------+
|                |
+----------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Added in MariaDB Xpand 6.1.0.

6.0

  • Not present.

5.3

  • Not present.

Release Series

History

6.0

  • Not present.

5.3

  • Not present.

Release Series

History

6.1

  • Added in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES