• Tom Lane's avatar
    Avoid spamming the client with multiple ParameterStatus messages. · 2432b1a0
    Tom Lane authored
    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
    2432b1a0
postgres.c 128 KB