diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2024-09-20 15:56:34 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2024-09-20 15:56:34 -0400 |
commit | 77930c5e92d943205cab4d3a27f435849723fec9 (patch) | |
tree | 435e07afca22a69e57aead10138fe4efa83530da | |
parent | 92a6cc5acbe0d341f6e48333db2e8862014caf89 (diff) |
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
-rw-r--r-- | doc/src/sgml/func.sgml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 10dd7958840..21e0a3b74eb 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -21762,6 +21762,10 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute'); the role (that is, the right to do <command>SET ROLE</command>), while <literal>USAGE</literal> denotes whether the privileges of the role are immediately available without doing <command>SET ROLE</command>. + <literal>WITH ADMIN OPTION</literal> or <literal>WITH GRANT + OPTION</literal> can be added to either of these privilege types to + test whether the <literal>ADMIN</literal> privilege is held (all + four 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. |