From 49f786a26110ca55d12c47f75e8662047e78c5c8 Mon Sep 17 00:00:00 2001
From: Christoph Berg <christoph.berg@credativ.de>
Date: Wed, 21 Nov 2018 15:43:34 +0100
Subject: [PATCH] Log PostgreSQL version number on startup

Logging the PostgreSQL version on startup is useful for two reasons:
There is a clear marker in the log file that a new postmaster is
beginning, and it's useful for tracking the server version across
startup while upgrading.
---
 src/backend/postmaster/postmaster.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index a33a131182..e0abfd686a 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -1306,6 +1306,10 @@ PostmasterMain(int argc, char *argv[])
 
 	whereToSendOutput = DestNone;
 
+	/* Report server startup in log */
+	ereport(LOG,
+			(errmsg("starting %s", PG_VERSION_STR)));
+
 	/*
 	 * Initialize stats collection subsystem (this does NOT start the
 	 * collector process!)
-- 
2.19.1

