v22-0001-Clean-up-postgres_fdw-t-010_subscription.pl.patch
text/x-patch
Filename: v22-0001-Clean-up-postgres_fdw-t-010_subscription.pl.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v22-0001
Subject: Clean up postgres_fdw/t/010_subscription.pl.
| File | + | − |
|---|---|---|
| contrib/postgres_fdw/t/010_subscription.pl | 4 | 11 |
From 7726c05c6338bfea1ccac68aaf8288fe8a165107 Mon Sep 17 00:00:00 2001
From: Jeff Davis <jeff@j-davis.com>
Date: Sat, 14 Mar 2026 11:03:53 -0700
Subject: [PATCH v22 1/6] Clean up postgres_fdw/t/010_subscription.pl.
The test was based on test/subscription/002_rep_changes.pl, but had
some leftover copy+paste problems that were useless and/or distracted
from the point of the test.
Discussion: https://postgr.es/m/CAA4eK1+=V_UFNHwcoMFqzy0F4AtS9_GyXhQDUzizgieQPWr=0A@mail.gmail.com
Reported-by: Amit Kapila <amit.kapila16@gmail.com>
---
contrib/postgres_fdw/t/010_subscription.pl | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/contrib/postgres_fdw/t/010_subscription.pl b/contrib/postgres_fdw/t/010_subscription.pl
index 1e41091badc..a04d64bb78c 100644
--- a/contrib/postgres_fdw/t/010_subscription.pl
+++ b/contrib/postgres_fdw/t/010_subscription.pl
@@ -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();
--
2.43.0