SET SESSION AUTHORIZATION sets the session user identifier and the current user identifier of the current SQL session to a specified user.
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.
1 | SET [ SESSION | LOCAL ] SESSION AUTHORIZATION role_name PASSWORD 'password'; |
1 2 | {SET [ SESSION | LOCAL ] SESSION AUTHORIZATION DEFAULT | RESET SESSION AUTHORIZATION}; |
Indicates that the specified parameters take effect for the current session.
Value range: A string. It must comply with the naming convention.
Indicates that the specified command takes effect only for the current transaction.
User name.
Value range: A string. It must comply with the naming convention.
Specifies the password of a role. It must comply with the password convention.
Reset the identifiers of the session and current users to the initially authenticated user names.
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; |