]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix EXCEPT publication test to check subscriber
authorFujii Masao <fujii@postgresql.org>
Fri, 24 Jul 2026 06:44:56 +0000 (15:44 +0900)
committerFujii Masao <fujii@postgresql.org>
Fri, 24 Jul 2026 06:44:56 +0000 (15:44 +0900)
Commit fd366065e06 added tests intended to verify that rows inserted
on the publisher are replicated to the subscriber when using multiple
publications, with one excluding the target table via EXCEPT and
another including it.

However, the tests queried the publisher instead of the subscriber.
Since the rows were inserted directly into the publisher, the checks
would always succeed, providing no coverage of replication.

Fix this by querying the subscriber so the tests verify the replicated
state.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwGfXUO7f4t6KNGurYwg6QsnLtpP0K3EACbAwYWtxGfKfQ@mail.gmail.com
Backpatch-through: 19

src/test/subscription/t/037_except.pl

index 8c58d282eeed0041004393a4a411d07e5f4ef3d0..43b51c8ff712e5e68fab060ec6a32c6b6b5ab8b6 100644 (file)
@@ -244,7 +244,7 @@ $node_publisher->safe_psql('postgres', qq(INSERT INTO tab1 VALUES(2)));
 $node_publisher->wait_for_catchup('tap_sub');
 
 $result =
-  $node_publisher->safe_psql('postgres', "SELECT * FROM tab1 ORDER BY a");
+  $node_subscriber->safe_psql('postgres', "SELECT * FROM tab1 ORDER BY a");
 is( $result, qq(1
 2),
        "check replication of a table in the EXCEPT clause of one publication but included by another"
@@ -272,7 +272,7 @@ $node_publisher->safe_psql('postgres', qq(INSERT INTO tab1 VALUES(2)));
 $node_publisher->wait_for_catchup('tap_sub');
 
 $result =
-  $node_publisher->safe_psql('postgres', "SELECT * FROM tab1 ORDER BY a");
+  $node_subscriber->safe_psql('postgres', "SELECT * FROM tab1 ORDER BY a");
 is( $result, qq(1
 2),
        "check replication of a table in the EXCEPT clause of one publication but included by another"