pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Minor GUC code refactoring.
Date: Fri, 27 Jan 2023 17:13:48 +0000
Message-ID: <E1pLSIN-000DTG-EN@gemulon.postgresql.org> (raw)

Minor GUC code refactoring.

Split out "ConfigOptionIsVisible" to perform the privilege
check for GUC_SUPERUSER_ONLY GUCs (which these days can also
be read by pg_read_all_settings role members), and move the
should-we-show-it checks from GetConfigOptionValues to its
sole caller.

This commit also removes get_explain_guc_options's check of
GUC_NO_SHOW_ALL, which seems to have got cargo-culted in there.
While there's no obvious use-case for marking a GUC both
GUC_EXPLAIN and GUC_NO_SHOW_ALL, if it were set up that way
one would expect EXPLAIN to show it --- if that's not what
you want, then don't set GUC_EXPLAIN.

In passing, simplify the loop logic in show_all_settings.

Nitin Jadhav, Bharath Rupireddy, Tom Lane

Discussion: https://postgr.es/m/CAMm1aWYgfekpRK-Jz5=pM_bV+Om=ktGq1vxTZ_dr1Z6MV-qokA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e4e89eb5bbfdae30349b38344e9c604411174f6b

Modified Files
--------------
src/backend/utils/misc/guc.c       | 13 +++----
src/backend/utils/misc/guc_funcs.c | 70 ++++++++++++++++++--------------------
src/include/utils/guc_tables.h     |  3 ++
3 files changed, 40 insertions(+), 46 deletions(-)



Message-ID: <E1pLSIN-000DTG-EN@gemulon.postgresql.org>
Permalink:  ../E1pLSIN-000DTG-EN@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pLSIN-000DTG-EN@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Minor GUC code refactoring.
  In-Reply-To: <E1pLSIN-000DTG-EN@gemulon.postgresql.org>
  References: <E1pLSIN-000DTG-EN@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox