Avoid updating our PgBackendStatus entry when track_activities is off.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: f7b0006f42913b6d641c9f0bef6fad1f670b9194
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2013-04-03T18:13:28Z
Releases: 9.3.0
Avoid updating our PgBackendStatus entry when track_activities is off.

The point of turning off track_activities is to avoid this reporting
overhead, but a thinko in commit 4f42b546fd87a80be30c53a0f2c897acb826ad52
caused pgstat_report_activity() to perform half of its updates anyway.
Fix that, and also make sure that we clear all the now-disabled fields
when transitioning to the non-reporting state.

Files

PathChange+/−
src/backend/postmaster/pgstat.c modified +23 −19
src/backend/utils/adt/pgstatfuncs.c modified +2 −9