From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid spamming the client with multiple ParameterStatus messages
Date: Wed, 25 Nov 2020 16:40:54 +0000
Message-ID: <E1khxqg-0003XW-Pf@gemulon.postgresql.org> (raw)
Avoid spamming the client with multiple ParameterStatus messages.
Up to now, we sent a ParameterStatus message to the client immediately
upon any change in the active value of any GUC_REPORT variable. This
was only barely okay when the feature was designed; now that we have
things like function SET clauses, there are very plausible use-cases
where a GUC_REPORT variable might change many times within a query
--- and even end up back at its original value, perhaps. Fortunately
most of our GUC_REPORT variables are unlikely to be changed often;
but there are proposals in play to enlarge that set, or even make it
user-configurable.
Hence, let's fix things to not generate more than one ParameterStatus
message per variable per query, and to not send any message at all
unless the end-of-query value is different from what we last reported.
Discussion: https://postgr.es/m/5708.1601145259@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/2432b1a04087edc2fd9536c7c9aa4ca03fd1b363
Modified Files
--------------
src/backend/tcop/postgres.c | 3 ++
src/backend/utils/misc/guc.c | 78 ++++++++++++++++++++++++++++++++++++++----
src/include/utils/guc.h | 1 +
src/include/utils/guc_tables.h | 5 ++-
4 files changed, 80 insertions(+), 7 deletions(-)
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: Avoid spamming the client with multiple ParameterStatus messages
In-Reply-To: <E1khxqg-0003XW-Pf@gemulon.postgresql.org>
References: <E1khxqg-0003XW-Pf@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