Skip to content

Commit a47ad3a

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 fb4f5e5 commit a47ad3a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/src/sgml/func.sgml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25220,6 +25220,10 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute');
2522025220
are immediately available without doing <command>SET ROLE</command>,
2522125221
while <literal>SET</literal> denotes whether it is possible to change
2522225222
to the role using the <literal>SET ROLE</literal> command.
25223+
<literal>WITH ADMIN OPTION</literal> or <literal>WITH GRANT
25224+
OPTION</literal> can be added to any of these privilege types to
25225+
test whether the <literal>ADMIN</literal> privilege is held (all
25226+
six spellings test the same thing).
2522325227
This function does not allow the special case of
2522425228
setting <parameter>user</parameter> to <literal>public</literal>,
2522525229
because the PUBLIC pseudo-role can never be a member of real roles.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy