aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c4
-rw-r--r--src/backend/utils/init/miscinit.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index a2846c41b58..07a7679479c 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7948,10 +7948,6 @@ ShutdownXLOG(int code, Datum arg)
ShutdownCommitTs();
ShutdownSUBTRANS();
ShutdownMultiXact();
-
- /* Don't be chatty in standalone mode */
- ereport(IsPostmasterEnvironment ? LOG : NOTICE,
- (errmsg("database system is shut down")));
}
/*
diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c
index b7bab56099f..603a2565b65 100644
--- a/src/backend/utils/init/miscinit.c
+++ b/src/backend/utils/init/miscinit.c
@@ -724,6 +724,17 @@ UnlinkLockFiles(int status, Datum arg)
}
/* Since we're about to exit, no need to reclaim storage */
lock_files = NIL;
+
+ /*
+ * Lock file removal should always be the last externally visible action
+ * of a postmaster or standalone backend, while we won't come here at all
+ * when exiting postmaster child processes. Therefore, this is a good
+ * place to log completion of shutdown. We could alternatively teach
+ * proc_exit() to do it, but that seems uglier. In a standalone backend,
+ * use NOTICE elevel to be less chatty.
+ */
+ ereport(IsPostmasterEnvironment ? LOG : NOTICE,
+ (errmsg("database system is shut down")));
}
/*