=== Applying patches on top of PostgreSQL commit ID 99139c46cbf2bda7880592c4e5da1ebf177888ac === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Aug 6 15:21:21 UTC 2025 On branch cf/4529 nothing to commit, working tree clean === using 'git am' to apply patch ./v14-0001-CREATE-SUSBCRIPTION-.-SERVER.patch === Applying: CREATE SUSBCRIPTION ... SERVER. Using index info to reconstruct a base tree... M contrib/postgres_fdw/connection.c M contrib/postgres_fdw/expected/postgres_fdw.out M contrib/postgres_fdw/meson.build M contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql M contrib/postgres_fdw/sql/postgres_fdw.sql M doc/src/sgml/ref/alter_subscription.sgml M doc/src/sgml/ref/create_subscription.sgml M src/backend/catalog/pg_subscription.c M src/backend/commands/foreigncmds.c M src/backend/commands/subscriptioncmds.c M src/backend/foreign/foreign.c M src/backend/parser/gram.y M src/backend/replication/logical/worker.c M src/bin/pg_dump/pg_dump.c M src/bin/pg_dump/pg_dump.h M src/bin/psql/tab-complete.in.c M src/include/catalog/pg_subscription.h M src/include/nodes/parsenodes.h Falling back to patching base and 3-way merge... Auto-merging src/include/nodes/parsenodes.h Auto-merging src/include/catalog/pg_subscription.h CONFLICT (content): Merge conflict in src/include/catalog/pg_subscription.h Auto-merging src/bin/psql/tab-complete.in.c Auto-merging src/bin/pg_dump/pg_dump.h CONFLICT (content): Merge conflict in src/bin/pg_dump/pg_dump.h Auto-merging src/bin/pg_dump/pg_dump.c CONFLICT (content): Merge conflict in src/bin/pg_dump/pg_dump.c Auto-merging src/backend/replication/logical/worker.c Auto-merging src/backend/parser/gram.y Auto-merging src/backend/foreign/foreign.c Auto-merging src/backend/commands/subscriptioncmds.c CONFLICT (content): Merge conflict in src/backend/commands/subscriptioncmds.c Auto-merging src/backend/commands/foreigncmds.c Auto-merging src/backend/catalog/pg_subscription.c Auto-merging doc/src/sgml/ref/create_subscription.sgml Auto-merging doc/src/sgml/ref/alter_subscription.sgml Auto-merging contrib/postgres_fdw/sql/postgres_fdw.sql Auto-merging contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql Auto-merging contrib/postgres_fdw/meson.build Auto-merging contrib/postgres_fdw/expected/postgres_fdw.out Auto-merging contrib/postgres_fdw/connection.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 CREATE SUSBCRIPTION ... SERVER. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M contrib/postgres_fdw/Makefile M contrib/postgres_fdw/connection.c M contrib/postgres_fdw/expected/postgres_fdw.out M contrib/postgres_fdw/meson.build M contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql M contrib/postgres_fdw/sql/postgres_fdw.sql M doc/src/sgml/ref/alter_subscription.sgml M doc/src/sgml/ref/create_subscription.sgml M src/backend/catalog/pg_subscription.c M src/backend/commands/foreigncmds.c M src/backend/commands/subscriptioncmds.c M src/backend/foreign/foreign.c M src/backend/parser/gram.y M src/backend/replication/logical/worker.c M src/bin/pg_dump/pg_dump.c M src/bin/pg_dump/pg_dump.h M src/bin/psql/tab-complete.in.c M src/include/catalog/pg_foreign_data_wrapper.h M src/include/catalog/pg_subscription.h M src/include/foreign/foreign.h M src/include/nodes/parsenodes.h M src/test/regress/expected/oidjoins.out Removing contrib/postgres_fdw/t/010_subscription.pl === using patch(1) to apply patch ./v14-0001-CREATE-SUSBCRIPTION-.-SERVER.patch === patching file contrib/postgres_fdw/Makefile patching file contrib/postgres_fdw/connection.c Hunk #2 succeeded at 2308 (offset 28 lines). patching file contrib/postgres_fdw/expected/postgres_fdw.out Hunk #1 succeeded at 267 (offset 11 lines). patching file contrib/postgres_fdw/meson.build patching file contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql patching file contrib/postgres_fdw/sql/postgres_fdw.sql Hunk #1 succeeded at 256 (offset 8 lines). patching file contrib/postgres_fdw/t/010_subscription.pl patching file doc/src/sgml/ref/alter_subscription.sgml patching file doc/src/sgml/ref/create_subscription.sgml patching file src/backend/catalog/pg_subscription.c Hunk #3 succeeded at 109 with fuzz 1 (offset 1 line). patching file src/backend/commands/foreigncmds.c Hunk #1 succeeded at 522 (offset 11 lines). Hunk #2 succeeded at 588 (offset 11 lines). Hunk #3 succeeded at 614 (offset 11 lines). Hunk #4 succeeded at 661 (offset 11 lines). Hunk #5 succeeded at 738 (offset 11 lines). Hunk #6 succeeded at 771 (offset 11 lines). Hunk #7 succeeded at 810 (offset 11 lines). patching file src/backend/commands/subscriptioncmds.c Hunk #1 succeeded at 27 (offset 1 line). Hunk #2 succeeded at 565 (offset 16 lines). Hunk #3 succeeded at 663 (offset 21 lines). Hunk #4 FAILED at 699. Hunk #5 succeeded at 744 (offset 23 lines). Hunk #6 succeeded at 877 (offset 27 lines). Hunk #7 succeeded at 1241 with fuzz 2 (offset 67 lines). Hunk #8 succeeded at 1271 (offset 70 lines). Hunk #9 succeeded at 1544 (offset 138 lines). Hunk #10 succeeded at 1887 (offset 158 lines). Hunk #11 succeeded at 1971 (offset 158 lines). Hunk #12 succeeded at 2091 (offset 158 lines). 1 out of 12 hunks FAILED -- saving rejects to file src/backend/commands/subscriptioncmds.c.rej patching file src/backend/foreign/foreign.c Hunk #1 succeeded at 72 (offset 1 line). Hunk #2 succeeded at 177 (offset 1 line). Hunk #3 succeeded at 217 (offset 1 line). patching file src/backend/parser/gram.y Hunk #1 succeeded at 5499 (offset 62 lines). Hunk #2 succeeded at 10917 (offset 111 lines). Hunk #3 succeeded at 10956 (offset 111 lines). patching file src/backend/replication/logical/worker.c Hunk #1 succeeded at 4711 (offset 724 lines). Hunk #2 succeeded at 4817 (offset 724 lines). Hunk #3 succeeded at 5417 (offset 740 lines). Hunk #4 succeeded at 5478 (offset 764 lines). patching file src/bin/pg_dump/pg_dump.c Hunk #1 succeeded at 5015 (offset 121 lines). Hunk #2 FAILED at 4975. Hunk #3 FAILED at 5012. Hunk #4 succeeded at 5163 (offset 130 lines). Hunk #5 succeeded at 5391 (offset 132 lines). 2 out of 5 hunks FAILED -- saving rejects to file src/bin/pg_dump/pg_dump.c.rej patching file src/bin/pg_dump/pg_dump.h Hunk #1 FAILED at 703. 1 out of 1 hunk FAILED -- saving rejects to file src/bin/pg_dump/pg_dump.h.rej patching file src/bin/psql/tab-complete.in.c Hunk #1 succeeded at 3767 (offset 63 lines). patching file src/include/catalog/pg_foreign_data_wrapper.h patching file src/include/catalog/pg_subscription.h Hunk #1 succeeded at 81 with fuzz 2 (offset 3 lines). Hunk #2 succeeded at 185 (offset 5 lines). patching file src/include/foreign/foreign.h patching file src/include/nodes/parsenodes.h Hunk #1 succeeded at 4329 (offset 47 lines). Hunk #2 succeeded at 4338 (offset 47 lines). Hunk #3 succeeded at 4353 (offset 47 lines). patching file src/test/regress/expected/oidjoins.out Unstaged changes after reset: M contrib/postgres_fdw/Makefile M contrib/postgres_fdw/connection.c M contrib/postgres_fdw/expected/postgres_fdw.out M contrib/postgres_fdw/meson.build M contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql M contrib/postgres_fdw/sql/postgres_fdw.sql M doc/src/sgml/ref/alter_subscription.sgml M doc/src/sgml/ref/create_subscription.sgml M src/backend/catalog/pg_subscription.c M src/backend/commands/foreigncmds.c M src/backend/commands/subscriptioncmds.c M src/backend/foreign/foreign.c M src/backend/parser/gram.y M src/backend/replication/logical/worker.c M src/bin/pg_dump/pg_dump.c M src/bin/psql/tab-complete.in.c M src/include/catalog/pg_foreign_data_wrapper.h M src/include/catalog/pg_subscription.h M src/include/foreign/foreign.h M src/include/nodes/parsenodes.h M src/test/regress/expected/oidjoins.out Removing contrib/postgres_fdw/t/010_subscription.pl Removing src/backend/commands/subscriptioncmds.c.rej Removing src/bin/pg_dump/pg_dump.c.rej Removing src/bin/pg_dump/pg_dump.h.rej === using 'git apply' to apply patch ./v14-0001-CREATE-SUSBCRIPTION-.-SERVER.patch === Applied patch to 'contrib/postgres_fdw/Makefile' cleanly. Applied patch to 'contrib/postgres_fdw/connection.c' cleanly. Applied patch to 'contrib/postgres_fdw/expected/postgres_fdw.out' cleanly. Applied patch to 'contrib/postgres_fdw/meson.build' cleanly. Applied patch to 'contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql' cleanly. Applied patch to 'contrib/postgres_fdw/sql/postgres_fdw.sql' cleanly. Falling back to direct application... Applied patch to 'doc/src/sgml/ref/alter_subscription.sgml' cleanly. Applied patch to 'doc/src/sgml/ref/create_subscription.sgml' cleanly. Applied patch to 'src/backend/catalog/pg_subscription.c' cleanly. Applied patch to 'src/backend/commands/foreigncmds.c' cleanly. Applied patch to 'src/backend/commands/subscriptioncmds.c' with conflicts. Applied patch to 'src/backend/foreign/foreign.c' cleanly. Applied patch to 'src/backend/parser/gram.y' cleanly. Applied patch to 'src/backend/replication/logical/worker.c' cleanly. Applied patch to 'src/bin/pg_dump/pg_dump.c' with conflicts. Applied patch to 'src/bin/pg_dump/pg_dump.h' with conflicts. Applied patch to 'src/bin/psql/tab-complete.in.c' cleanly. Applied patch to 'src/include/catalog/pg_foreign_data_wrapper.h' cleanly. Applied patch to 'src/include/catalog/pg_subscription.h' with conflicts. Applied patch to 'src/include/foreign/foreign.h' cleanly. Applied patch to 'src/include/nodes/parsenodes.h' cleanly. Applied patch to 'src/test/regress/expected/oidjoins.out' cleanly. U src/backend/commands/subscriptioncmds.c U src/bin/pg_dump/pg_dump.c U src/bin/pg_dump/pg_dump.h U src/include/catalog/pg_subscription.h diff --cc src/backend/commands/subscriptioncmds.c index cd6c3684482,9b9ab6657aa..00000000000 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@@ -691,10 -699,12 +720,19 @@@ CreateSubscription(ParseState *pstate, values[Anum_pg_subscription_subpasswordrequired - 1] = BoolGetDatum(opts.passwordrequired); values[Anum_pg_subscription_subrunasowner - 1] = BoolGetDatum(opts.runasowner); values[Anum_pg_subscription_subfailover - 1] = BoolGetDatum(opts.failover); ++<<<<<<< ours + values[Anum_pg_subscription_subretaindeadtuples - 1] = + BoolGetDatum(opts.retaindeadtuples); + values[Anum_pg_subscription_subconninfo - 1] = + CStringGetTextDatum(conninfo); ++======= + values[Anum_pg_subscription_subserver - 1] = serverid; + if (!OidIsValid(serverid)) + values[Anum_pg_subscription_subconninfo - 1] = + CStringGetTextDatum(conninfo); + else + nulls[Anum_pg_subscription_subconninfo - 1] = true; ++>>>>>>> theirs if (opts.slot_name) values[Anum_pg_subscription_subslotname - 1] = DirectFunctionCall1(namein, CStringGetDatum(opts.slot_name)); @@@ -1202,11 -1178,15 +1250,18 @@@ AlterSubscription(ParseState *pstate, A aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_SUBSCRIPTION, stmt->subname); - sub = GetSubscription(subid, false); + /* + * Skip ACL checks on the subscription's foreign server, if any. If + * changing the server (or replacing it with a raw connection), then the + * old one will be removed anyway. If changing something unrelated, + * there's no need to do an additional ACL check here; that will be done + * by the subscription worker anyway. + */ + sub = GetSubscription(subid, false, false); + retain_dead_tuples = sub->retaindeadtuples; + origin = sub->origin; + /* * Don't allow non-superuser modification of a subscription with * password_required=false. diff --cc src/bin/pg_dump/pg_dump.c index f3a353a61a5,a7a70535fa0..00000000000 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@@ -5098,15 -4977,19 +5099,31 @@@ getSubscriptions(Archive *fout appendPQExpBufferStr(query, " s.subfailover,\n"); else ++<<<<<<< ours + appendPQExpBufferStr(query, + " false AS subfailover,\n"); + + if (fout->remoteVersion >= 190000) + appendPQExpBufferStr(query, + " s.subretaindeadtuples\n"); + else + appendPQExpBufferStr(query, + " false AS subretaindeadtuples\n"); ++======= + appendPQExpBuffer(query, + " false AS subfailover,\n"); + + if (dopt->binary_upgrade && fout->remoteVersion >= 180000) + appendPQExpBufferStr(query, " fs.srvname AS subservername,\n" + " o.remote_lsn AS suboriginremotelsn,\n" + " s.subenabled,\n" + " s.subfailover\n"); + else + appendPQExpBufferStr(query, " NULL AS subservername,\n" + " NULL AS suboriginremotelsn,\n" + " false AS subenabled,\n" + " false AS subfailover\n"); ++>>>>>>> theirs appendPQExpBufferStr(query, "FROM pg_subscription s\n"); @@@ -5140,7 -5025,7 +5159,11 @@@ i_subpasswordrequired = PQfnumber(res, "subpasswordrequired"); i_subrunasowner = PQfnumber(res, "subrunasowner"); i_subfailover = PQfnumber(res, "subfailover"); ++<<<<<<< ours + i_subretaindeadtuples = PQfnumber(res, "subretaindeadtuples"); ++======= + i_subservername = PQfnumber(res, "subservername"); ++>>>>>>> theirs i_subconninfo = PQfnumber(res, "subconninfo"); i_subslotname = PQfnumber(res, "subslotname"); i_subsynccommit = PQfnumber(res, "subsynccommit"); diff --cc src/bin/pg_dump/pg_dump.h index dde85ed156c,6c553765ea1..00000000000 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@@ -716,7 -703,7 +716,11 @@@ typedef struct _SubscriptionInf bool subpasswordrequired; bool subrunasowner; bool subfailover; ++<<<<<<< ours + bool subretaindeadtuples; ++======= + char *subservername; ++>>>>>>> theirs char *subconninfo; char *subslotname; char *subsynccommit; diff --cc src/include/catalog/pg_subscription.h index 231ef84ec9a,93067ea9182..00000000000 --- a/src/include/catalog/pg_subscription.h +++ b/src/include/catalog/pg_subscription.h @@@ -78,8 -78,7 +78,12 @@@ CATALOG(pg_subscription,6100,Subscripti * slots) in the upstream database are enabled * to be synchronized to the standbys. */ ++<<<<<<< ours + bool subretaindeadtuples; /* True if dead tuples useful for + * conflict detection are retained */ ++======= + Oid subserver; /* Set if connecting with server */ ++>>>>>>> theirs #ifdef CATALOG_VARLEN /* variable-length fields start here */ /* Connection string to the publisher */