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:
@ -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)
|
||||
|
Reference in New Issue
Block a user