SET ROLE
Sets the current role for the session. Learn how to enable none, or a specific role to change your current privileges dynamically.
Last updated
Was this helpful?
Was this helpful?
+--------------+
| CURRENT_ROLE |
+--------------+
| staff |
+--------------+--switching to 'admin' role, and verifying the switch
SET ROLE admin;
SELECT CURRENT_ROLE;+--------------+
| CURRENT_ROLE |
+--------------+
| admin |
+--------------+--Removing the active role
SET ROLE NONE;
SELECT CURRENT_ROLE();+----------------+
| CURRENT_ROLE() |
+----------------+
| NULL |
+----------------+