Prevent starting a standalone backend with standby_mode on.
authorTom Lane
Wed, 31 Aug 2016 12:52:13 +0000 (08:52 -0400)
committerTom Lane
Wed, 31 Aug 2016 12:52:13 +0000 (08:52 -0400)
commitf4e40537e1ea3b9c620cb80da97dc56eb088fc4b
tree3628334a8faeee3f8d414a0fc31639eea788a7ed
parent314a25fb3ae3ae2fc6007fd39ff01da7558565a4
Prevent starting a standalone backend with standby_mode on.

This can't really work because standby_mode expects there to be more
WAL arriving, which there will not ever be because there's no WAL
receiver process to fetch it.  Moreover, if standby_mode is on then
hot standby might also be turned on, causing even more strangeness
because that expects read-only sessions to be executing in parallel.
Bernd Helmle reported a case where btree_xlog_delete_get_latestRemovedXid
got confused, but rather than band-aiding individual problems it seems
best to prevent getting anywhere near this state in the first place.
Back-patch to all supported branches.

In passing, also fix some omissions of errcodes in other ereport's in
readRecoveryCommandFile().

Michael Paquier (errcode hacking by me)

Discussion: <00F0B2CEF6D0CEF8A90119D4@eje.credativ.lan>
src/backend/access/transam/xlog.c