aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2017-03-07 21:06:09 +0800
committerSimon Riggs <simon@2ndQuadrant.com>2017-03-07 21:06:09 +0800
commit5ee2197767f648bc21e324e751b84d42af573b43 (patch)
treeb90acc95b325921e0e6617bd3543bbc29d490521 /src
parent1fff35d872321015a87ca55042384b83f51dedcf (diff)
downloadpostgresql-5ee2197767f648bc21e324e751b84d42af573b43.tar.gz
postgresql-5ee2197767f648bc21e324e751b84d42af573b43.zip
Ensure ThisTimeLineID is valid before START_REPLICATION
Craig Ringer
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/walsender.c5
1 files changed, 5 insertions, 0 deletions
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().