postgres.git / summary / log / commit / refs
commit 5ee2197767f648bc21e324e751b84d42af573b43
Author: Simon Riggs <simon@2ndQuadrant.com>
Date: Tue Mar 07 13:06:09 2017 +0000
First released in: 10.0
Ensure ThisTimeLineID is valid before START_REPLICATION
Craig Ringer
src/backend/replication/walsender.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 9cf9eb0e4cb..dd3a936fc68 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().
[parent: 1fff35d87232]