From: Amit Kapila Date: Fri, 31 Jul 2026 04:28:46 +0000 (+0530) Subject: Improve wording of sequence origin warning in logical replication. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00b3e50054dad648e74d19cc199555381ab366d2;p=thirdparty%2Fpostgresql.git Improve wording of sequence origin warning in logical replication. check_publications_origin_sequences() warns when a subscription with origin = NONE synchronizes sequence values that may have originated from another subscription. The existing warning is phrased in terms of copy_data and copying data, which is appropriate for table synchronization but misleading for sequence synchronization. Reword the warning, detail, and hint to describe sequence synchronization and the associated origin = NONE semantics more accurately. Also fix a typo ("rathen" -> "rather") in a comment in sequencesync.c. Reported-by: Noah Misch Reported-by: Peter Smith Author: vignesh C Reviewed-by: Amit Kapila Backpatch-through: 19, where it was introduced Discussion: https://postgr.es/m/20260710045217.f0.noahmisch@microsoft.com --- diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 013ac46db07..67f5699b2c7 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -3334,12 +3334,12 @@ check_publications_origin_sequences(WalReceiverConn *wrconn, List *publications, ereport(WARNING, errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("subscription \"%s\" requested copy_data with origin = NONE but might copy data that had a different origin", + errmsg("subscription \"%s\" requested origin = NONE but might synchronize sequence values that had a different origin", subname), - errdetail_plural("The subscription subscribes to a publication (%s) that contains sequences that are written to by other subscriptions.", - "The subscription subscribes to publications (%s) that contain sequences that are written to by other subscriptions.", + errdetail_plural("The subscription subscribes to a publication (%s) that contains sequences that are synchronized from other subscriptions.", + "The subscription subscribes to publications (%s) that contain sequences that are synchronized from other subscriptions.", list_length(publist), pubnames.data), - errhint("Verify that initial data copied from the publisher sequences did not come from other origins.")); + errhint("Verify that the initial values copied from the publisher sequences did not come from other origins.")); } ExecDropSingleTupleTableSlot(slot); diff --git a/src/backend/replication/logical/sequencesync.c b/src/backend/replication/logical/sequencesync.c index 0423745a428..ea24827aa9e 100644 --- a/src/backend/replication/logical/sequencesync.c +++ b/src/backend/replication/logical/sequencesync.c @@ -755,7 +755,7 @@ LogicalRepSyncSequences(void) /* * Lock the sequence so its identity (namespace and name) cannot * change under us via a concurrent DROP, RENAME or SET SCHEMA. The - * lock is released immediately rathen than at the transaction end. + * lock is released immediately rather than at the transaction end. * The later synchronization does not depend on this captured identity * remaining valid, as it re-opens the sequence and tolerates * concurrent changes. Releasing early also avoids holding one lock