pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Silence extra logging when using "postgres -C" on runtime-comput
Date: Wed, 11 May 2022 05:34:11 +0000
Message-ID: <E1noezC-0007X2-P0@gemulon.postgresql.org> (raw)

Silence extra logging when using "postgres -C" on runtime-computed GUCs

Presently, the server may emit a variety of log messages when inspecting
a runtime-computed GUC, mostly in the shape of one LOG message with the
default configuration, related to the startup sequence launched as such
GUCs require a load of the control file and of external shared
libraries.

For example, the server will always emit a "database system is shut
down" LOG (unless the user has set log_min_messages higher than LOG),
which is an annoying behavior as "postgres -C" is expected to only emit
in its output the parameter value we are looking for.  The parameter
value is sent to stdout, while the logs are sent to stderr so we could
recommend to use a redirection, but there was not much love for this
workaround either.

To avoid such extra log messages, per discussion, this change sets
log_min_messages to FATAL internally when -C is used on a
runtime-computed GUC (even if set to PANIC in postgresql.conf).  At
FATAL, the user will still receive messages explaining why a GUC value
cannot be inspected, and will know if the command is attempted on a
server already running, something not supported yet for a
runtime-computed GUC.

Reported-by: Magnus Hagander, Bruce Momjian
Author: Nathan Bossart, Michael Paquier
Discussion: https://postgr.es/m/Yni6ZHkGotUU+RSf@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8bbf8461a3a2a38ce5f2952a025385b6938a61f7

Modified Files
--------------
doc/src/sgml/runtime.sgml           |  2 +-
src/backend/postmaster/postmaster.c | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)



Message-ID: <E1noezC-0007X2-P0@gemulon.postgresql.org>
Permalink:  ../E1noezC-0007X2-P0@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1noezC-0007X2-P0@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: michael@paquier.xyz
  Subject: Re: pgsql: Silence extra logging when using "postgres -C" on runtime-comput
  In-Reply-To: <E1noezC-0007X2-P0@gemulon.postgresql.org>
  References: <E1noezC-0007X2-P0@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