An upcoming patch splits single user mode handling out of PostgresMain(). The
startup time only needs to be determined in single user mode. Currently the
initialization happens late, which makes the split a bit harder. As postmaster
determines the time earlier it makes sense to move the time for single user
mode to a roughly similar point in time.
Reviewd-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/
20210802164124.ufo5buo4apl6yuvs@alap3.anarazel.de
InitializeMaxBackends();
CreateSharedMemoryAndSemaphores();
+
+ /*
+ * Remember stand-alone backend startup time, roughly at the same
+ * point during startup that postmaster does so.
+ */
+ PgStartTime = GetCurrentTimestamp();
}
/*
initStringInfo(&row_description_buf);
MemoryContextSwitchTo(TopMemoryContext);
- /*
- * Remember stand-alone backend startup time
- */
- if (!IsUnderPostmaster)
- PgStartTime = GetCurrentTimestamp();
-
/*
* POSTGRES main processing loop begins here
*