v23-0003-Add-pg_dump-tests-related-to-CREATE-SUBSCRIPTION.patch
text/x-patch
Filename: v23-0003-Add-pg_dump-tests-related-to-CREATE-SUBSCRIPTION.patch
Type: text/x-patch
Part: 2
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 v23-0003
Subject: Add pg_dump tests related to CREATE SUBSCRIPTION ... SERVER.
| File | + | − |
|---|---|---|
| src/bin/pg_dump/t/002_pg_dump.pl | 49 | 0 |
From 92ce5061780886ddf22398d829e047bb27b135a8 Mon Sep 17 00:00:00 2001
From: Jeff Davis <jeff@j-davis.com>
Date: Sat, 14 Mar 2026 15:07:52 -0700
Subject: [PATCH v23 3/4] Add pg_dump tests related to CREATE SUBSCRIPTION ...
SERVER.
Suggested-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/CAExHW5vV5znEvecX=ra2-v7UBj9-M6qvdDzuB78M-TxbYD1PEA@mail.gmail.com
---
src/bin/pg_dump/t/002_pg_dump.pl | 49 ++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index 051a3d8ea3d..c0cbdd4c65e 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -2846,6 +2846,40 @@ my %tests = (
like => { %full_runs, section_pre_data => 1, },
},
+ 'CREATE FUNCTION public.test_fdw_connection(oid, oid, internal)' => {
+ create_order => 37,
+ create_sql => "CREATE FUNCTION public.test_fdw_connection(oid, oid, internal) RETURNS text AS '\$libdir/regress', 'test_fdw_connection' LANGUAGE C;",
+ regexp => qr/^
+ \QCREATE FUNCTION public.test_fdw_connection(oid, oid, internal) \E
+ \QRETURNS text\E
+ \n\s+\QLANGUAGE c\E
+ \n\s+AS\ \'\$
+ \Qlibdir\/regress', 'test_fdw_connection';\E
+ /xm,
+ like => { %full_runs, section_pre_data => 1, },
+ },
+
+ 'CREATE FOREIGN DATA WRAPPER test_fdw CONNECTION public.test_fdw_connection' => {
+ create_order => 38,
+ create_sql => 'CREATE FOREIGN DATA WRAPPER test_fdw CONNECTION public.test_fdw_connection;',
+ regexp => qr/CREATE FOREIGN DATA WRAPPER test_fdw CONNECTION public.test_fdw_connection;/m,
+ like => { %full_runs, section_pre_data => 1, },
+ },
+
+ 'CREATE SERVER s2 FOREIGN DATA WRAPPER test_fdw' => {
+ create_order => 39,
+ create_sql => 'CREATE SERVER s2 FOREIGN DATA WRAPPER test_fdw;',
+ regexp => qr/CREATE SERVER s2 FOREIGN DATA WRAPPER test_fdw;/m,
+ like => { %full_runs, section_pre_data => 1, },
+ },
+
+ 'CREATE USER MAPPING FOR public SERVER s2' => {
+ create_order => 40,
+ create_sql => 'CREATE USER MAPPING FOR public SERVER s2;',
+ regexp => qr/CREATE USER MAPPING FOR public SERVER s2;/m,
+ like => { %full_runs, section_pre_data => 1, },
+ },
+
'CREATE FOREIGN TABLE dump_test.foreign_table SERVER s1' => {
create_order => 88,
create_sql =>
@@ -3287,6 +3321,21 @@ my %tests = (
},
},
+ 'CREATE SUBSCRIPTION sub4 SERVER s2' => {
+ create_order => 50,
+ create_sql => 'CREATE SUBSCRIPTION sub4
+ SERVER s2 PUBLICATION pub1
+ WITH (connect = false, slot_name = NONE, origin = any, streaming = on);',
+ regexp => qr/^
+ \QCREATE SUBSCRIPTION sub4 SERVER s2 PUBLICATION pub1 WITH (connect = false, slot_name = NONE, streaming = on);\E
+ /xm,
+ like => { %full_runs, section_post_data => 1, },
+ unlike => {
+ no_subscriptions => 1,
+ no_subscriptions_restore => 1,
+ },
+ },
+
# Regardless of whether the table or schema is excluded, publications must
# still be dumped, as excluded objects do not apply to publications. We
--
2.43.0