Thread: SET ROLE versus SET SESSION AUTHORIZATION

SET ROLE versus SET SESSION AUTHORIZATION

From
PG Doc comments form
Date:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/sql-set-role.html
Description:

"SET ROLE has effects comparable to SET SESSION AUTHORIZATION, but the
privilege checks involved are quite different."

What are the differences in privilege checks?

How are the two commands the same and different, semantically?

Re: SET ROLE versus SET SESSION AUTHORIZATION

From
Laurenz Albe
Date:
On Tue, 2024-01-30 at 17:25 +0000, PG Doc comments form wrote:
> Page: https://www.postgresql.org/docs/16/sql-set-role.html
> Description:
>
> "SET ROLE has effects comparable to SET SESSION AUTHORIZATION, but the
> privilege checks involved are quite different."
>
> What are the differences in privilege checks?
>
> How are the two commands the same and different, semantically?

The difference is revealed by "SELECT session_user".

I think that is pretty clearly described in the SET SESSION AUTHORIZATION
documentation page.

Yours,
Laurenz Albe