Re: is_superuser is not documented - Mailing list pgsql-hackers

From Joseph Koshakow
Subject Re: is_superuser is not documented
Date
Msg-id CAAvxfHeiP1KT8uDe2yf7RLN0hbscXsrwQxy4Xq+zMULbSEYfaw@mail.gmail.com
Whole thread Raw
In response to Re: is_superuser is not documented  (Bruce Momjian <bruce@momjian.us>)
Responses Re: is_superuser is not documented  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
On Wed, Mar 29, 2023 at 5:21 PM Bruce Momjian <bruce@momjian.us> wrote:
>
>    On Thu, Mar  2, 2023 at 12:00:43PM -0500, Joseph Koshakow wrote:
>    >
>    >
>    > On Thu, Mar 2, 2023 at 11:53 AM Fujii Masao <masao.fujii@oss.nttdata.com>
>    > wrote:
>    > >
>    > >    On 2022/09/14 14:27, bt22kawamotok wrote:
>    > >    > I update patch to reflect master update.
>    > >
>    > >    Thanks for updating the patch!
>    > >
>    > >    +       <para>
>    > >    +        Shows whether the current user is a superuser or not.
>    > >    +       </para>
>    > >
>    > >    How about adding the note about when this parameter can change,
>    > >    like we do for in_hot_standby docs?  I applied this change to the patch.
>    > >    Attached is the updated version of the patch.
>    > >
>    >
>    > I just came across this thread and noticed that the patch was never
>    > merged. There is some brief docs for is_superuser in the SHOW docs:
>    > https://www.postgresql.org/docs/current/sql-show.html, but the GUC
>    > fields were never updated.
>    >
>    > Is there a reason that it never got merged or was it just forgotten
>    > about?
>
>    Uh, where are you looking?  I see it in the SGML, and in the PG 15 docs:
>
>            https://www.postgresql.org/docs/current/sql-show.html
>
>            IS_SUPERUSER
>
>                True if the current role has superuser privileges.

The patch updated the guc table for is_superuser in
src/backend/utils/misc/guc_tables.c

    - /* Not for general use --- used by SET SESSION AUTHORIZATION */
    - {"is_superuser", PGC_INTERNAL, UNGROUPED,
    + {"is_superuser", PGC_INTERNAL, PRESET_OPTIONS,
      gettext_noop("Shows whether the current user is a superuser."),
      NULL,
    - GUC_REPORT | GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
    + GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE

However, when I look at the code on master I don't see this update

    /* Not for general use --- used by SET SESSION AUTHORIZATION */
    {"is_superuser", PGC_INTERNAL, UNGROUPED,
    gettext_noop("Shows whether the current user is a superuser."),
    NULL,
    GUC_REPORT | GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE

Similarly, when running `SHOW ALL` against master I don't see the
is_superuser variable

    $ /usr/local/pgsql/bin/psql -c "SHOW ALL" test | grep is_superuser
    $

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: zstd compression for pg_dump
Next
From: Justin Pryzby
Date:
Subject: Re: zstd compression for pg_dump