v2-0001-PG17-amit.1.patch.txt

text/plain

Filename: v2-0001-PG17-amit.1.patch.txt
Type: text/plain
Part: 1
Message: Re: Fix slot synchronization with two_phase decoding enabled
diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index 8308ccaad5a..df7ab827f7d 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -657,7 +657,7 @@ CreateSubscription(ParseState *pstate, CreateSubscriptionStmt *stmt,
 	if (opts.twophase && opts.failover)
 		ereport(ERROR,
 				errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-				errmsg("cannot enable failover option when two_phase option is enabled"));
+				errmsg("failover and two_phase are mutually exclusive options"));
 
 	/*
 	 * If built with appropriate switch, whine when regression-testing
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index c1bbd16254e..da510f60f9c 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -357,7 +357,7 @@ ReplicationSlotCreate(const char *name, bool db_specific,
 		if (two_phase)
 			ereport(ERROR,
 					errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-					errmsg("cannot enable failover for a replication slot that enables two-phase decoding"));
+					errmsg("failover and two_phase are mutually exclusive options"));
 	}
 
 	/*
@@ -873,7 +873,7 @@ ReplicationSlotAlter(const char *name, bool failover)
 	if (failover && MyReplicationSlot->data.two_phase)
 		ereport(ERROR,
 				errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-				errmsg("cannot enable failover for a replication slot that enables two-phase decoding"));
+				errmsg("cannot enable failover for a two-phase enabled replication slot"));
 
 	if (MyReplicationSlot->data.failover != failover)
 	{