Categories:
Context Functions (Session Object)

CURRENT_ROLE

Returns the name of the role in use for the current session.

To specify a different role for the session, execute the USE ROLE command.

Syntax

CURRENT_ROLE()

Arguments

None.

Examples

This demonstrates CURRENT_ROLE():

SELECT CURRENT_ROLE();

Output:

+----------------+
| CURRENT_ROLE() |
|----------------|
| SYSADMIN       |
+----------------+