SET ROLE

Function

SET ROLE sets the current user identifier of the current session.

Precautions

Syntax

Parameter Description

Examples

Create a role named manager:

1
CREATE ROLE paul IDENTIFIED BY '{Password}';

Set the current user to paul:

1
SET ROLE paul PASSWORD '{Password}';

View the current session user and the current user:

1
SELECT SESSION_USER, CURRENT_USER;

Reset the current user:

1
RESET role;