SET ROLE
Sets the active role of the current session
DSQL
SET ROLE {role_name | NONE}
| Parameter | Description |
|---|---|
role_name |
The name of the role to apply |
The SET ROLE statement allows a user to assume a different role;it sets the CURRENT_ROLE context variable to role_name, if that role has been granted to the CURRENT_USER.For this session, the user receives the privileges granted by that role.Any rights granted to the previous role are removed from the session.Use NONE instead of role_name to clear the CURRENT_ROLE.
When the specified role does not exist or has not been explicitly granted to the user, the error “Role role_name is invalid or unavailable” is raised.