diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-04-03 14:13:28 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-04-03 14:13:28 -0400 |
commit | f7b0006f42913b6d641c9f0bef6fad1f670b9194 (patch) | |
tree | 4d98980b1f171458210a651b003338cd4b190ef2 /src/backend/utils/adt/pgstatfuncs.c | |
parent | 0f1345d38b4d7b35175d4f4be322da0aa6d6aaeb (diff) |
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.
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
-rw-r--r-- | src/backend/utils/adt/pgstatfuncs.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index e6ec37296e5..8c1a76728de 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -666,15 +666,8 @@ pg_stat_get_activity(PG_FUNCTION_ARGS) nulls[4] = true; break; } - if (beentry->st_state == STATE_UNDEFINED || - beentry->st_state == STATE_DISABLED) - { - values[5] = CStringGetTextDatum(""); - } - else - { - values[5] = CStringGetTextDatum(beentry->st_activity); - } + + values[5] = CStringGetTextDatum(beentry->st_activity); values[6] = BoolGetDatum(beentry->st_waiting); if (beentry->st_xact_start_timestamp != 0) |