From e427e08ba7b372c58c09f914e75f985e19e5b208 Mon Sep 17 00:00:00 2001
From: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Date: Fri, 4 Sep 2026 11:09:41 +0900
Subject: [PATCH v1 1/3] Reproduce missing output_plugin_libraries issue

---
 src/bin/pg_basebackup/meson.build          |  1 +
 src/bin/pg_basebackup/t/041_missing_guc.pl | 51 ++++++++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 src/bin/pg_basebackup/t/041_missing_guc.pl

diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build
index d70ce5786a2..a92475b5426 100644
--- a/src/bin/pg_basebackup/meson.build
+++ b/src/bin/pg_basebackup/meson.build
@@ -103,6 +103,7 @@ tests += {
       't/020_pg_receivewal.pl',
       't/030_pg_recvlogical.pl',
       't/040_pg_createsubscriber.pl',
+      't/041_missing_guc.pl',
     ],
   },
 }
diff --git a/src/bin/pg_basebackup/t/041_missing_guc.pl b/src/bin/pg_basebackup/t/041_missing_guc.pl
new file mode 100644
index 00000000000..e85b5de0def
--- /dev/null
+++ b/src/bin/pg_basebackup/t/041_missing_guc.pl
@@ -0,0 +1,51 @@
+# Copyright (c) 2026, PostgreSQL Global Development Group
+
+use strict;
+use warnings FATAL => 'all';
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
+use Test::More;
+
+# Set up node P as primary
+my $node_p = PostgreSQL::Test::Cluster->new('node_p');
+my $pconnstr = $node_p->connstr;
+$node_p->init(allows_streaming => 'logical');
+
+# Remove pgoutput from output_plugin_libraries
+$node_p->append_conf('postgresql.conf', "output_plugin_libraries = 'test_decoding'");
+$node_p->start;
+
+# Set up node S as standby linking to node P
+$node_p->backup('backup');
+my $node_s = PostgreSQL::Test::Cluster->new('node_s');
+$node_s->init_from_backup($node_p, 'backup', has_streaming => 1);
+
+# --dry-run succeeds
+command_ok(
+	[
+		'pg_createsubscriber',
+		'--verbose',
+        '--dry-run',
+		'--pgdata' => $node_s->data_dir,
+		'--publisher-server' => $pconnstr,
+		'--socketdir' => $node_s->host,
+		'--subscriber-port' => $node_s->port,
+		'--database' => 'postgres',
+	],
+	'run pg_createsubscriber --dry-run on node S');
+
+
+# ... but actual run fails
+command_ok(
+	[
+		'pg_createsubscriber',
+		'--verbose',
+		'--pgdata' => $node_s->data_dir,
+		'--publisher-server' => $pconnstr,
+		'--socketdir' => $node_s->host,
+		'--subscriber-port' => $node_s->port,
+		'--database' => 'postgres',
+	],
+	'run pg_createsubscriber on node S');
+
+done_testing();
-- 
2.52.0

