]> 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:28:46 +0000 (09:58 +0530)
committerAmit Kapila <akapila@postgresql.org>
Fri, 31 Jul 2026 04:28:46 +0000 (09:58 +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 013ac46db0725af63d9418b25e05c6cca682b667..67f5699b2c7c706c696a5ad4e3e77084ca2e4cbd 100644 (file)
@@ -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);
index 0423745a428a6f2eaf231a7513aa2073b9ee519f..ea24827aa9ebcdc0cfff30a98acd287b3b2fcbfd 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