SET SESSION AUTHORIZATION

Function

SET SESSION AUTHORIZATION sets the session user identifier and the current user identifier of the current SQL session to a specified user.

Precautions

The session identifier can be changed only when the initial session user has the system administrator rights. Otherwise, the system supports the command only when the authenticated user name is specified.

Syntax

Parameter Description

Examples

Set the current user to paul.

1
SET SESSION AUTHORIZATION paul password '{password}';

View the current session user and the current user.

1
SELECT SESSION_USER, CURRENT_USER;

Reset the current user.

1
RESET SESSION AUTHORIZATION;

Helpful Links

SET ROLE