Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit953cf49

Browse files
doc: Note exceptions for SET ROLE's effect on privilege checks.
The documentation for SET ROLE states that superusers who switch toa non-superuser role lose their superuser privileges. While thisis true for most commands, there are exceptions such as SET ROLEand SET SESSION AUTHORIZATION, which continue to use the currentsession user and the authenticated user, respectively.Furthermore, the description of this command already describes itseffect, so it is arguably unnecessary to include this special case.This commit removes the note about the superuser case and adds asentence about the aforementioned exceptions to the description.Co-authored-by: Yurii RashkovskiiReviewed-by: Shubham Khanna, Robert Haas, Michael PaquierDiscussion:https://postgr.es/m/CA%2BRLCQysHtME0znk2KUMJN343ksboSRQSU-hCnOjesX6VK300Q%40mail.gmail.com
1 parente0df808 commit953cf49

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ RESET ROLE
3737
written as either an identifier or a string literal.
3838
After <command>SET ROLE</command>, permissions checking for SQL commands
3939
is carried out as though the named role were the one that had logged
40-
in originally.
40+
in originally. Note that <command>SET ROLE</command> and
41+
<command>SET SESSION AUTHORIZATION</command> are exceptions; permissions
42+
checks for those continue to use the current session user and the initial
43+
session user (the <firstterm>authenticated user</firstterm>), respectively.
4144
</para>
4245

4346
<para>
@@ -88,11 +91,6 @@ RESET ROLE
8891
exercised either with or without <literal>SET ROLE</literal>.
8992
</para>
9093

91-
<para>
92-
Note that when a superuser chooses to <command>SET ROLE</command> to a
93-
non-superuser role, they lose their superuser privileges.
94-
</para>
95-
9694
<para>
9795
<command>SET ROLE</command> has effects comparable to
9896
<link linkend="sql-set-session-authorization"><command>SET SESSION AUTHORIZATION</command></link>, but the privilege

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp