Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4a1b95f

Browse filesBrowse files
committed
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
1 parent 1041643 commit 4a1b95f
Copy full SHA for 4a1b95f

File tree

Expand file treeCollapse file tree

1 file changed

+10
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-3
lines changed

‎doc/src/sgml/ref/set_role.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/set_role.sgml
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,16 @@ RESET ROLE
5353
</para>
5454

5555
<para>
56-
The <literal>NONE</literal> and <literal>RESET</literal> forms reset the current
57-
user identifier to be the current session user identifier.
58-
These forms can be executed by any user.
56+
<literal>SET ROLE NONE</literal> sets the current user identifier to the
57+
current session user identifier, as returned by
58+
<function>session_user</function>. <literal>RESET ROLE</literal> sets the
59+
current user identifier to the connection-time setting specified by the
60+
<link linkend="libpq-connect-options">command-line options</link>,
61+
<link linkend="sql-alterrole"><command>ALTER ROLE</command></link>, or
62+
<link linkend="sql-alterdatabase"><command>ALTER DATABASE</command></link>,
63+
if any such settings exist. Otherwise, <literal>RESET ROLE</literal> sets
64+
the current user identifier to the current session user identifier. These
65+
forms can be executed by any user.
5966
</para>
6067
</refsect1>
6168

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.