1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

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 4f42b546fd
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.
This commit is contained in:
Tom Lane
2013-04-03 14:13:28 -04:00
parent 0f1345d38b
commit f7b0006f42
2 changed files with 25 additions and 28 deletions

View File

@ -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)