Re: is_superuser is not documented

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Joseph Koshakow <koshy44(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: is_superuser is not documented
Date: 2023-04-11 13:37:40
Message-ID: a3747546-92f6-93c9-de11-5353f573fcd5@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023/04/08 23:53, Joseph Koshakow wrote:
>
>
> On Mon, Apr 3, 2023 at 10:47 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com <mailto:masao(dot)fujii(at)oss(dot)nttdata(dot)com>> wrote:
> >    Yes, the patch has not been committed yet because of lack of review comments.
> >    Do you have any review comments on this patch?
> >    Or you think it's ready for committer?
>
> I'm not very familiar with this code, so I'm not sure how much my
> review is worth, but maybe it will spark some discussion.

Thanks for the comments!

> > Yes, this patch moves the descriptions of is_superuser to config.sgml
> > and changes its group to PRESET_OPTIONS.
>
> is_superuser feels a little out of place in this file. All of
> the options here apply to the entire PostgreSQL server, while
> is_superuser only applies to the current session.

Aren't other preset options like lc_collate, lc_ctype and server_encoding
similar to is_superuser? They seem to behave in a similar way as their
settings can be different for each connection depending on the connected database.

> I'm not familiar with the origins of is_superuser and it may be too
> late for this, but it seems like is_superuser would fit in much better
> as a system information function [0] rather than a GUC. Particularly
> in the Session Information Functions.

I understand your point, but I think it would be more confusing to document
is_superuser there because it's defined and behaves differently from
session information functions like current_user. For instance,
the value of is_superuser can be displayed using SHOW command,
while current_user cannot. Therefore, it's better to keep is_superuser
separate from the session information functions.

> As a side note server_version, server_encoding, lc_collate, and
> lc_ctype all appear in both the preset options section of config.sgml
> and in show.sgml. I'm not sure what the logic is for just including
> these three parameters in show.sgml, but I think we should either
> include all of the preset options or none of them.

Agreed. I think that it's better to just treat them as GUCs and
remove their descriptions from show.sgml.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-04-11 13:49:25 Re: When to drop src/tools/msvc support
Previous Message David Rowley 2023-04-11 13:28:08 Protecting allocator headers with Valgrind