On Wed, Aug 24, 2016 at 5:07 PM, Bernd Helmle <maili...@oopsware.de> wrote:
> That said, i'm okay if --single is not intended to bring up a hot standby.
> There are many other ways to debug such problems.

This patch is still on the CF app:
https://commitfest.postgresql.org/10/610/
Even after thinking about it, my opinion is still the same. Let's
prevent a standalone backend to start if it sees recovery.conf.
Attached is a patch and the CF entry is switched as ready for
committer to move on.
-- 
Michael
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index acd95aa..3d88727 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5930,6 +5930,18 @@ StartupXLOG(void)
 	struct stat st;
 
 	/*
+	 * Prevent standalone process to start if recovery is wanted. A lot of
+	 * code paths in recovery depend on the assumption that it is not the
+	 * case.
+	 */
+	if (!IsPostmasterEnvironment)
+	{
+		if (stat(RECOVERY_COMMAND_FILE, &st) == 0)
+			ereport(FATAL,
+					(errmsg("recovery.conf is not allowed with a standalone process")));
+	}
+
+	/*
 	 * Read control file and check XLOG status looks valid.
 	 *
 	 * Note: in most control paths, *ControlFile is already valid and we need
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to