This routine can currently only be called from the postmaster in
single-user mode or the checkpointer, but there was no sanity check to
make sure that this was always the case.
This has proved to be useful when hacking the zone (at least to me), to
make sure that the write of the pgstats file happens at shutdown, as
wanted by design, in the correct process context.
Discussion: https://postgr.es/m/
[email protected]
pgstat_assert_is_up();
+ /* should be called only by the checkpointer or single user mode */
+ Assert(!IsUnderPostmaster || MyBackendType == B_CHECKPOINTER);
+
/* we're shutting down, so it's ok to just override this */
pgstat_fetch_consistency = PGSTAT_FETCH_CONSISTENCY_NONE;