diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 09f50bf4942..f3e723230c9 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -1754,7 +1754,8 @@ ServerLoop(void) PgArchPID = pgarch_start(); /* If we have lost the stats collector, try to start a new one */ - if (PgStatPID == 0 && pmState == PM_RUN) + if (PgStatPID == 0 && + (pmState == PM_RUN || pmState == PM_HOT_STANDBY)) PgStatPID = pgstat_start(); /* If we need to signal the autovacuum launcher, do so now */ @@ -2902,7 +2903,7 @@ reaper(SIGNAL_ARGS) if (!EXIT_STATUS_0(exitstatus)) LogChildExit(LOG, _("statistics collector process"), pid, exitstatus); - if (pmState == PM_RUN) + if (pmState == PM_RUN || pmState == PM_HOT_STANDBY) PgStatPID = pgstat_start(); continue; }