]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Clean up postgres_fdw/t/010_subscription.pl.
authorJeff Davis <jdavis@postgresql.org>
Mon, 16 Mar 2026 20:42:55 +0000 (13:42 -0700)
committerJeff Davis <jdavis@postgresql.org>
Mon, 16 Mar 2026 20:42:55 +0000 (13:42 -0700)
The test was based on test/subscription/002_rep_changes.pl, but had
some leftover copy+paste problems that were useless and/or
distracting.

Discussion: https://postgr.es/m/CAA4eK1+=V_UFNHwcoMFqzy0F4AtS9_GyXhQDUzizgieQPWr=0A@mail.gmail.com
Reported-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
contrib/postgres_fdw/t/010_subscription.pl

index 1e41091badc1a455f2eca6b486d05a6b1107d9fb..a04d64bb78ca2db405b0b0c7a071fe545429a669 100644 (file)
@@ -1,7 +1,8 @@
 
 # Copyright (c) 2021-2026, PostgreSQL Global Development Group
 
-# Basic logical replication test
+# Test postgres_fdw foreign server for use with a subscription.
+
 use strict;
 use warnings FATAL => 'all';
 use PostgreSQL::Test::Cluster;
@@ -22,11 +23,6 @@ $node_subscriber->start;
 $node_publisher->safe_psql('postgres',
        "CREATE TABLE tab_ins AS SELECT a, a + 1 as b FROM generate_series(1,1002) AS a");
 
-# Replicate the changes without columns
-$node_publisher->safe_psql('postgres', "CREATE TABLE tab_no_col()");
-$node_publisher->safe_psql('postgres',
-       "INSERT INTO tab_no_col default VALUES");
-
 # Setup structure on subscriber
 $node_subscriber->safe_psql('postgres', "CREATE EXTENSION postgres_fdw");
 $node_subscriber->safe_psql('postgres', "CREATE TABLE tab_ins (a int, b int)");
@@ -45,9 +41,6 @@ $node_subscriber->safe_psql('postgres',
        "CREATE USER MAPPING FOR PUBLIC SERVER tap_server"
 );
 
-$node_subscriber->safe_psql('postgres',
-       "CREATE FOREIGN TABLE f_tab_ins (a int, b int) SERVER tap_server OPTIONS(table_name 'tab_ins')"
-);
 $node_subscriber->safe_psql('postgres',
        "CREATE SUBSCRIPTION tap_sub SERVER tap_server PUBLICATION tap_pub WITH (password_required=false)"
 );
@@ -56,7 +49,7 @@ $node_subscriber->safe_psql('postgres',
 $node_subscriber->wait_for_subscription_sync($node_publisher, 'tap_sub');
 
 my $result =
-  $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM (SELECT f.b = l.b as match FROM tab_ins l, f_tab_ins f WHERE l.a = f.a) WHERE match");
+  $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM tab_ins");
 is($result, qq(1002), 'check that initial data was copied to subscriber');
 
 $node_publisher->safe_psql('postgres',
@@ -65,7 +58,7 @@ $node_publisher->safe_psql('postgres',
 $node_publisher->wait_for_catchup('tap_sub');
 
 $result =
-  $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM (SELECT f.b = l.b as match FROM tab_ins l, f_tab_ins f WHERE l.a = f.a) WHERE match");
+  $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM tab_ins");
 is($result, qq(1050), 'check that inserted data was copied to subscriber');
 
 done_testing();