Skip to content

Commit cf9f6b4

Browse files
committed
Doc: explain how to test ADMIN privilege with pg_has_role().
This has always been possible, but the syntax is a bit obscure, and our user-facing docs were not very helpful. Spell it out more clearly. Per complaint from Dominique Devienne. Back-patch to all supported branches. Discussion: https://postgr.es/m/CAFCRh-8JNEy+dV4SXFOrWca50u+d=--TO4cq=+ac1oBtfJy4AA@mail.gmail.com
1 parent 6aed7c4 commit cf9f6b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/src/sgml/func.sgml

+4
Original file line numberDiff line numberDiff line change
@@ -22594,6 +22594,10 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute');
2259422594
the role (that is, the right to do <command>SET ROLE</command>), while
2259522595
<literal>USAGE</literal> denotes whether the privileges of the role
2259622596
are immediately available without doing <command>SET ROLE</command>.
22597+
<literal>WITH ADMIN OPTION</literal> or <literal>WITH GRANT
22598+
OPTION</literal> can be added to either of these privilege types to
22599+
test whether the <literal>ADMIN</literal> privilege is held (all
22600+
four spellings test the same thing).
2259722601
This function does not allow the special case of
2259822602
setting <parameter>user</parameter> to <literal>public</literal>,
2259922603
because the PUBLIC pseudo-role can never be a member of real roles.

0 commit comments

Comments
 (0)