]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Improve wording of sequence origin warning in logical replication.
authorAmit Kapila <akapila@postgresql.org>
Fri, 31 Jul 2026 04:21:08 +0000 (09:51 +0530)
committerAmit Kapila <akapila@postgresql.org>
Fri, 31 Jul 2026 04:21:08 +0000 (09:51 +0530)
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 <noah@leadboat.com>
Reported-by: Peter Smith <smithpb2250@gmail.com>
Author: vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 19, where it was introduced
Discussion: https://postgr.es/m/20260710045217.f0.noahmisch@microsoft.com

src/backend/commands/subscriptioncmds.c
src/backend/replication/logical/sequencesync.c

index 5eca5a5bb4a2223027694f9c4bc25e7b8cb940d0..e330fb13e42e3f3524ef0025abd7340cadd9eec4 100644 (file)
@@ -3126,12 +3126,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);
index bd74a17d28bbdc141b17f90734e93195e2ee6239..9f0d2762dad9b09725443fc34f3ab5d0140487d9 100644 (file)
@@ -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