aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-09-20 15:56:34 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-09-20 15:56:34 -0400
commita2ebf3274a43acf7ae36d608fc26090b803ab6e1 (patch)
tree50f15c71ff7235da829724267f9c4cf2f5984eaa /doc/src
parentc00c54a9ac1e0c52ace8051a30805ca74ae53212 (diff)
downloadpostgresql-a2ebf3274a43acf7ae36d608fc26090b803ab6e1.tar.gz
postgresql-a2ebf3274a43acf7ae36d608fc26090b803ab6e1.zip
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 6f75bd0c7d2..e39d524b6bd 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25289,6 +25289,10 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute');
are immediately available without doing <command>SET ROLE</command>,
while <literal>SET</literal> denotes whether it is possible to change
to the role using the <literal>SET ROLE</literal> command.
+ <literal>WITH ADMIN OPTION</literal> or <literal>WITH GRANT
+ OPTION</literal> can be added to any of these privilege types to
+ test whether the <literal>ADMIN</literal> privilege is held (all
+ six spellings test the same thing).
This function does not allow the special case of
setting <parameter>user</parameter> to <literal>public</literal>,
because the PUBLIC pseudo-role can never be a member of real roles.