doc: Clarify requirements for SET ROLE.
authorNathan Bossart <[email protected]>
Sun, 24 Mar 2024 20:23:55 +0000 (15:23 -0500)
committerNathan Bossart <[email protected]>
Sun, 24 Mar 2024 20:23:55 +0000 (15:23 -0500)
Since commit 3d14e171e9, SET ROLE has required the current session
user to have membership with the SET option in the target role, but
the SET ROLE documentation only mentions the membership
requirement.  This commit adds this important detail to the SET
ROLE page.

Reviewed-by: Robert Haas
Discussion: https://postgr.es/m/CA%2BRLCQysHtME0znk2KUMJN343ksboSRQSU-hCnOjesX6VK300Q%40mail.gmail.com
Backpatch-through: 16

doc/src/sgml/ref/set_role.sgml

index 13bad1bf66eee82c832c07713e3be7fd79dd3367..083e6dc6ea98f00c79938240ab85971dba3b846f 100644 (file)
@@ -41,8 +41,10 @@ RESET ROLE
   </para>
 
   <para>
-   The specified <replaceable class="parameter">role_name</replaceable>
-   must be a role that the current session user is a member of.
+   The current session user must have the <literal>SET</literal> option for the
+   specified <replaceable class="parameter">role_name</replaceable>, either
+   directly or indirectly via a chain of memberships with the
+   <literal>SET</literal> option.
    (If the session user is a superuser, any role can be selected.)
   </para>