aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index e37b86494e1..87dc060b201 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -638,7 +638,11 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
/* Reset CurrentResourceOwner to nothing for the moment */
CurrentResourceOwner = NULL;
- on_shmem_exit(ShutdownXLOG, 0);
+ /*
+ * Use before_shmem_exit() so that ShutdownXLOG() can rely on DSM
+ * segments etc to work (which in turn is required for pgstats).
+ */
+ before_shmem_exit(ShutdownXLOG, 0);
}
/*