diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index acd95aa..5426f75 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4957,6 +4957,16 @@ readRecoveryCommandFile(void) errmsg("could not open recovery command file \"%s\": %m", RECOVERY_COMMAND_FILE))); } + else if (!IsPostmasterEnvironment) + { + /* + * 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 so recovery would just badly fail. + */ + ereport(FATAL, + (errmsg("recovery.conf is not allowed in a standalone process"))); + } /* * Since we're asking ParseConfigFp() to report errors as FATAL, there's