From: Simon Riggs Date: Tue, 7 Mar 2017 13:06:09 +0000 (+0800) Subject: Ensure ThisTimeLineID is valid before START_REPLICATION X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=5ee2197767f648bc21e324e751b84d42af573b43;p=users%2Fheikki%2Fpostgres.git Ensure ThisTimeLineID is valid before START_REPLICATION Craig Ringer --- diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 9cf9eb0e4c..dd3a936fc6 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -488,6 +488,11 @@ StartReplication(StartReplicationCmd *cmd) StringInfoData buf; 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 * log-shipping, since this is checked in PostmasterMain().