Re: is_superuser is not documented

From: Joseph Koshakow <koshy44(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, bt22kawamotok <bt22kawamotok(at)oss(dot)nttdata(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: is_superuser is not documented
Date: 2023-04-01 13:34:06
Message-ID: CAAvxfHeiP1KT8uDe2yf7RLN0hbscXsrwQxy4Xq+zMULbSEYfaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 29, 2023 at 5:21 PM Bruce Momjian <bruce(at)momjian(dot)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(dot)fujii(at)oss(dot)nttdata(dot)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
$

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2023-04-01 13:36:44 Re: zstd compression for pg_dump
Previous Message Tomas Vondra 2023-04-01 12:49:44 Re: zstd compression for pg_dump