From: Joe Conway Date: Fri, 2 Apr 2021 17:48:56 +0000 (-0400) Subject: Clarify documentation of RESET ROLE X-Git-Tag: REL9_6_22~28 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=9e67a9440736be87d4013ce2d23faa131523c07e;p=postgresql.git Clarify documentation of RESET ROLE Command-line options, or previous "ALTER (ROLE|DATABASE) ... SET ROLE ..." commands, can change the value of the default role for a session. In the presence of one of these, RESET ROLE will change the current user identifier to the default role rather than the session user identifier. Fix the documentation to reflect this reality. Backpatch to all supported versions. Author: Nathan Bossart Reviewed-By: Laurenz Albe, David G. Johnston, Joe Conway Reported by: Nathan Bossart Discussion: https://postgr.es/m/flat/925134DB-8212-4F60-8AB1-B1231D750CB4%40amazon.com Backpatch-through: 9.6 --- diff --git a/doc/src/sgml/ref/set_role.sgml b/doc/src/sgml/ref/set_role.sgml index b346adb2d4c..49961fb934a 100644 --- a/doc/src/sgml/ref/set_role.sgml +++ b/doc/src/sgml/ref/set_role.sgml @@ -53,9 +53,16 @@ RESET ROLE - The NONE and RESET forms reset the current - user identifier to be the current session user identifier. - These forms can be executed by any user. + SET ROLE NONE sets the current user identifier to the + current session user identifier, as returned by + session_user. RESET ROLE sets the + current user identifier to the connection-time setting specified by the + command-line options, + ALTER ROLE, or + ALTER DATABASE, + if any such settings exist. Otherwise, RESET ROLE sets + the current user identifier to the current session user identifier. These + forms can be executed by any user.