aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Conway <mail@joeconway.com>2021-04-02 13:48:53 -0400
committerJoe Conway <mail@joeconway.com>2021-04-02 13:48:53 -0400
commit5ef79d4062b81c69204c58eacfc81bd38641235a (patch)
treeeea2df59820ff20ea742e1c19febcaee87c13a9d
parent89bd8e8b332841247649551e95c8d22c19a97529 (diff)
downloadpostgresql-5ef79d4062b81c69204c58eacfc81bd38641235a.tar.gz
postgresql-5ef79d4062b81c69204c58eacfc81bd38641235a.zip
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
-rw-r--r--doc/src/sgml/ref/set_role.sgml13
1 files changed, 10 insertions, 3 deletions
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
</para>
<para>
- The <literal>NONE</> and <literal>RESET</> forms reset the current
- user identifier to be the current session user identifier.
- These forms can be executed by any user.
+ <literal>SET ROLE NONE</> sets the current user identifier to the
+ current session user identifier, as returned by
+ <function>session_user</function>. <literal>RESET ROLE</> sets the
+ current user identifier to the connection-time setting specified by the
+ <link linkend="libpq-connect-options">command-line options</link>,
+ <link linkend="sql-alterrole"><command>ALTER ROLE</command></link>, or
+ <link linkend="sql-alterdatabase"><command>ALTER DATABASE</command></link>,
+ if any such settings exist. Otherwise, <literal>RESET ROLE</> sets
+ the current user identifier to the current session user identifier. These
+ forms can be executed by any user.
</para>
</refsect1>