diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-11-25 11:40:44 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-11-25 11:40:44 -0500 |
commit | 2432b1a04087edc2fd9536c7c9aa4ca03fd1b363 (patch) | |
tree | 4540b2dc58b1e75c8341f4268b69de1a5d5977c9 /src/backend/tcop/postgres.c | |
parent | f73999262ed6c40d9a7c3d7cccec7143d4d15287 (diff) | |
download | postgresql-2432b1a04087edc2fd9536c7c9aa4ca03fd1b363.tar.gz postgresql-2432b1a04087edc2fd9536c7c9aa4ca03fd1b363.zip |
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
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 7c5f7c775b9..34ed0e7558c 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -4229,6 +4229,9 @@ PostgresMain(int argc, char *argv[], pgstat_report_activity(STATE_IDLE, NULL); } + /* Report any recently-changed GUC options */ + ReportChangedGUCOptions(); + ReadyForQuery(whereToSendOutput); send_ready_for_query = false; } |