=== Applying patches on top of PostgreSQL commit ID 11ed011ae22a620b01a43634b5eea2f9af5c709c === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Jul 15 14:57:27 UTC 2026 On branch cf/6924 nothing to commit, working tree clean === using 'git am' to apply patch ./v1-0001-Add-a-hook-for-handling-logical-messages-on-subsc.patch === Applying: Add a hook for handling logical messages on subscribers. Using index info to reconstruct a base tree... M src/backend/catalog/pg_subscription.c M src/backend/catalog/system_views.sql M src/backend/commands/subscriptioncmds.c M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c M src/bin/pg_dump/pg_dump.c M src/bin/psql/describe.c M src/include/catalog/pg_subscription.h M src/include/replication/walreceiver.h M src/test/regress/expected/subscription.out M src/test/regress/sql/subscription.sql M src/tools/pgindent/typedefs.list Falling back to patching base and 3-way merge... Auto-merging src/tools/pgindent/typedefs.list Auto-merging src/test/regress/sql/subscription.sql Auto-merging src/test/regress/expected/subscription.out Auto-merging src/include/replication/walreceiver.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/describe.c Auto-merging src/bin/pg_dump/pg_dump.c Auto-merging src/backend/replication/libpqwalreceiver/libpqwalreceiver.c Auto-merging src/backend/commands/subscriptioncmds.c CONFLICT (content): Merge conflict in src/backend/commands/subscriptioncmds.c Auto-merging src/backend/catalog/system_views.sql CONFLICT (content): Merge conflict in src/backend/catalog/system_views.sql Auto-merging src/backend/catalog/pg_subscription.c CONFLICT (content): Merge conflict in src/backend/catalog/pg_subscription.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 Add a hook for handling logical messages on subscribers. 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". === using patch(1) to apply patch ./v1-0001-Add-a-hook-for-handling-logical-messages-on-subsc.patch === patching file src/backend/catalog/pg_subscription.c Hunk #1 FAILED at 132. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/catalog/pg_subscription.c.rej patching file src/backend/catalog/system_views.sql Hunk #1 FAILED at 1528. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/catalog/system_views.sql.rej patching file src/backend/commands/subscriptioncmds.c Hunk #1 FAILED at 79. Hunk #2 succeeded at 108 with fuzz 1 (offset 3 lines). Hunk #3 succeeded at 202 (offset 9 lines). Hunk #4 succeeded at 362 (offset 11 lines). Hunk #5 FAILED at 686. Hunk #6 succeeded at 861 (offset 25 lines). Hunk #7 FAILED at 1512. Hunk #8 succeeded at 2051 with fuzz 1 (offset 180 lines). 3 out of 8 hunks FAILED -- saving rejects to file src/backend/commands/subscriptioncmds.c.rej patching file src/backend/replication/libpqwalreceiver/libpqwalreceiver.c patching file src/backend/replication/logical/proto.c patching file src/backend/replication/logical/worker.c patching file src/bin/pg_dump/pg_dump.c Hunk #1 succeeded at 5138 (offset -46 lines). Hunk #2 succeeded at 5237 (offset -46 lines). Hunk #3 succeeded at 5293 (offset -46 lines). Hunk #4 succeeded at 5351 (offset -46 lines). Hunk #5 succeeded at 5605 (offset -46 lines). patching file src/bin/pg_dump/pg_dump.h patching file src/bin/psql/describe.c Hunk #1 succeeded at 6893 with fuzz 2 (offset -200 lines). Hunk #2 succeeded at 6969 (offset -210 lines). patching file src/include/catalog/pg_subscription.h Hunk #2 FAILED at 174. 1 out of 2 hunks FAILED -- saving rejects to file src/include/catalog/pg_subscription.h.rej patching file src/include/replication/logicalproto.h patching file src/include/replication/walreceiver.h patching file src/include/replication/worker_internal.h patching file src/test/modules/Makefile patching file src/test/modules/meson.build patching file src/test/modules/test_logicalmsg_hooks/.gitignore patching file src/test/modules/test_logicalmsg_hooks/Makefile patching file src/test/modules/test_logicalmsg_hooks/meson.build patching file src/test/modules/test_logicalmsg_hooks/t/001_basic.pl patching file src/test/modules/test_logicalmsg_hooks/test_logicalmsg_hooks.c patching file src/test/regress/expected/subscription.out patching file src/test/regress/sql/subscription.sql patching file src/tools/pgindent/typedefs.list Hunk #1 succeeded at 1707 (offset 6 lines). Unstaged changes after reset: M src/backend/commands/subscriptioncmds.c M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c M src/backend/replication/logical/proto.c 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/describe.c M src/include/catalog/pg_subscription.h M src/include/replication/logicalproto.h M src/include/replication/walreceiver.h M src/include/replication/worker_internal.h M src/test/modules/Makefile M src/test/modules/meson.build M src/test/regress/expected/subscription.out M src/test/regress/sql/subscription.sql M src/tools/pgindent/typedefs.list Removing src/backend/catalog/pg_subscription.c.rej Removing src/backend/catalog/system_views.sql.rej Removing src/backend/commands/subscriptioncmds.c.rej Removing src/include/catalog/pg_subscription.h.rej Removing src/test/modules/test_logicalmsg_hooks/ === using 'git apply' to apply patch ./v1-0001-Add-a-hook-for-handling-logical-messages-on-subsc.patch === Applied patch to 'src/backend/catalog/pg_subscription.c' with conflicts. Applied patch to 'src/backend/catalog/system_views.sql' with conflicts. Applied patch to 'src/backend/commands/subscriptioncmds.c' with conflicts. Applied patch to 'src/backend/replication/libpqwalreceiver/libpqwalreceiver.c' cleanly. Applied patch to 'src/backend/replication/logical/proto.c' cleanly. Applied patch to 'src/backend/replication/logical/worker.c' cleanly. Applied patch to 'src/bin/pg_dump/pg_dump.c' cleanly. Applied patch to 'src/bin/pg_dump/pg_dump.h' cleanly. Applied patch to 'src/bin/psql/describe.c' cleanly. Applied patch to 'src/include/catalog/pg_subscription.h' with conflicts. Applied patch to 'src/include/replication/logicalproto.h' cleanly. Applied patch to 'src/include/replication/walreceiver.h' cleanly. Applied patch to 'src/include/replication/worker_internal.h' cleanly. Applied patch to 'src/test/modules/Makefile' cleanly. Applied patch to 'src/test/modules/meson.build' cleanly. Falling back to direct application... Falling back to direct application... Falling back to direct application... Falling back to direct application... Falling back to direct application... Applied patch to 'src/test/regress/expected/subscription.out' cleanly. Applied patch to 'src/test/regress/sql/subscription.sql' cleanly. Applied patch to 'src/tools/pgindent/typedefs.list' cleanly. U src/backend/catalog/pg_subscription.c U src/backend/catalog/system_views.sql U src/backend/commands/subscriptioncmds.c U src/include/catalog/pg_subscription.h diff --cc src/backend/catalog/pg_subscription.c index 2068e03c571,f14649a245b..00000000000 --- a/src/backend/catalog/pg_subscription.c +++ b/src/backend/catalog/pg_subscription.c @@@ -132,7 -132,7 +132,11 @@@ GetSubscription(Oid subid, bool missing sub->retaindeadtuples = subform->subretaindeadtuples; sub->maxretention = subform->submaxretention; sub->retentionactive = subform->subretentionactive; ++<<<<<<< ours + sub->conflictlogrelid = subform->subconflictlogrelid; ++======= + sub->message = subform->submessage; ++>>>>>>> theirs if (conninfo_needed) { diff --cc src/backend/catalog/system_views.sql index 090281a03dd,6ebaa93b1ff..00000000000 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@@ -1538,8 -1527,8 +1538,13 @@@ GRANT SELECT (oid, subdbid, subskiplsn subbinary, substream, subtwophasestate, subdisableonerr, subpasswordrequired, subrunasowner, subfailover, subretaindeadtuples, submaxretention, subretentionactive, ++<<<<<<< ours + subserver, subconflictlogrelid, subconflictlogdest, subslotname, + subsynccommit, subwalrcvtimeout, subpublications, suborigin) ++======= + subserver, subslotname, subsynccommit, subwalrcvtimeout, + subpublications, suborigin, submessage) ++>>>>>>> theirs ON pg_subscription TO public; CREATE VIEW pg_stat_subscription_stats AS diff --cc src/backend/commands/subscriptioncmds.c index 3de358f9374,5183ab01156..00000000000 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@@ -81,7 -79,7 +81,11 @@@ #define SUBOPT_WAL_RECEIVER_TIMEOUT 0x00010000 #define SUBOPT_LSN 0x00020000 #define SUBOPT_ORIGIN 0x00040000 ++<<<<<<< ours +#define SUBOPT_CONFLICT_LOG_DEST 0x00080000 ++======= + #define SUBOPT_MESSAGE 0x00080000 ++>>>>>>> theirs /* check if the 'val' has 'bits' set */ #define IsSet(val, bits) (((val) & (bits)) == (bits)) @@@ -108,9 -106,9 +112,10 @@@ typedef struct SubOpt bool runasowner; bool failover; bool retaindeadtuples; + bool message; int32 maxretention; char *origin; + ConflictLogDest conflictlogdest; XLogRecPtr lsn; char *wal_receiver_timeout; } SubOpts; @@@ -698,8 -687,7 +714,12 @@@ CreateSubscription(ParseState *pstate, SUBOPT_RUN_AS_OWNER | SUBOPT_FAILOVER | SUBOPT_RETAIN_DEAD_TUPLES | SUBOPT_MAX_RETENTION_DURATION | ++<<<<<<< ours + SUBOPT_WAL_RECEIVER_TIMEOUT | SUBOPT_ORIGIN | + SUBOPT_CONFLICT_LOG_DEST); ++======= + SUBOPT_WAL_RECEIVER_TIMEOUT | SUBOPT_ORIGIN | SUBOPT_MESSAGE); ++>>>>>>> theirs parse_subscription_options(pstate, stmt->options, supported_opts, &opts); /* @@@ -1650,8 -1513,7 +1671,12 @@@ AlterSubscription(ParseState *pstate, A SUBOPT_RETAIN_DEAD_TUPLES | SUBOPT_MAX_RETENTION_DURATION | SUBOPT_WAL_RECEIVER_TIMEOUT | ++<<<<<<< ours + SUBOPT_ORIGIN | + SUBOPT_CONFLICT_LOG_DEST); ++======= + SUBOPT_ORIGIN | SUBOPT_MESSAGE); ++>>>>>>> theirs break; case ALTER_SUBSCRIPTION_ENABLED: @@@ -2010,32 -1872,10 +2035,39 @@@ replaces[Anum_pg_subscription_subwalrcvtimeout - 1] = true; } ++<<<<<<< ours + if (IsSet(opts.specified_opts, SUBOPT_CONFLICT_LOG_DEST)) + { + ConflictLogDest old_dest = + GetConflictLogDest(sub->conflictlogdest); + + if (opts.conflictlogdest != old_dest) + { + bool update_relid; + Oid relid = InvalidOid; + + values[Anum_pg_subscription_subconflictlogdest - 1] = + CStringGetTextDatum(ConflictLogDestNames[opts.conflictlogdest]); + replaces[Anum_pg_subscription_subconflictlogdest - 1] = true; + + update_relid = alter_sub_conflict_log_dest(sub, + old_dest, + opts.conflictlogdest, + &relid); + if (update_relid) + { + values[Anum_pg_subscription_subconflictlogrelid - 1] = + ObjectIdGetDatum(relid); + replaces[Anum_pg_subscription_subconflictlogrelid - 1] = + true; + } + } ++======= + if (IsSet(opts.specified_opts, SUBOPT_MESSAGE)) + { + values[Anum_pg_subscription_submessage - 1] = BoolGetDatum(opts.message); + replaces[Anum_pg_subscription_submessage - 1] = true; ++>>>>>>> theirs } update_tuple = true; diff --cc src/include/catalog/pg_subscription.h index 65ce8e145fb,cdda8265573..00000000000 --- a/src/include/catalog/pg_subscription.h +++ b/src/include/catalog/pg_subscription.h @@@ -180,7 -174,8 +183,12 @@@ typedef struct Subscriptio List *publications; /* List of publication names to subscribe to */ char *origin; /* Only publish data originating from the * specified origin */ ++<<<<<<< ours + char *conflictlogdest; /* Conflict log destination */ ++======= + bool message; /* True if the subscription wants to receive + * logical messages */ ++>>>>>>> theirs } Subscription; #ifdef EXPOSE_TO_CLIENT_CODE