diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 3f9ed549f92..82d22e4eed7 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -4052,6 +4052,12 @@ PostgresMain(int argc, char *argv[], InitializeMaxBackends(); CreateSharedMemoryAndSemaphores(); + + /* + * Remember stand-alone backend startup time, roughly at the same + * point during startup that postmaster does so. + */ + PgStartTime = GetCurrentTimestamp(); } /* @@ -4161,12 +4167,6 @@ PostgresMain(int argc, char *argv[], initStringInfo(&row_description_buf); MemoryContextSwitchTo(TopMemoryContext); - /* - * Remember stand-alone backend startup time - */ - if (!IsUnderPostmaster) - PgStartTime = GetCurrentTimestamp(); - /* * POSTGRES main processing loop begins here *