1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

Ensure ThisTimeLineID is valid before START_REPLICATION

Craig Ringer
This commit is contained in:
Simon Riggs
2017-03-07 21:06:09 +08:00
parent 1fff35d872
commit 5ee2197767

View File

@ -488,6 +488,11 @@ StartReplication(StartReplicationCmd *cmd)
StringInfoData buf; StringInfoData buf;
XLogRecPtr FlushPtr; XLogRecPtr FlushPtr;
if (ThisTimeLineID == 0)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("IDENTIFY_SYSTEM has not been run before START_REPLICATION")));
/* /*
* We assume here that we're logging enough information in the WAL for * We assume here that we're logging enough information in the WAL for
* log-shipping, since this is checked in PostmasterMain(). * log-shipping, since this is checked in PostmasterMain().