=== Applying patches on top of PostgreSQL commit ID 3ff475ac12ec8d8d07cf3fd86144659285a59d83 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sun Oct 4 20:37:31 UTC 2026 On branch cf/6047 nothing to commit, working tree clean === using 'git am' to apply patch ./v4-0001-logical-replication-make-old_tuple-s-flag-match-i.patch === Applying: logical replication: make old_tuple's flag match its contents === using 'git am' to apply patch ./v4-0002-Enforce-leaf-root-replica-identity-coverage-under.patch === Applying: Enforce leaf/root replica-identity coverage under publish_via_partition_root Using index info to reconstruct a base tree... M src/backend/commands/publicationcmds.c M src/backend/commands/tablecmds.c M src/test/regress/expected/publication.out M src/test/regress/sql/publication.sql Falling back to patching base and 3-way merge... Auto-merging src/test/regress/sql/publication.sql Auto-merging src/test/regress/expected/publication.out Auto-merging src/backend/commands/tablecmds.c CONFLICT (content): Merge conflict in src/backend/commands/tablecmds.c Auto-merging src/backend/commands/publicationcmds.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 Enforce leaf/root replica-identity coverage under publish_via_partition_root 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 ./v4-0002-Enforce-leaf-root-replica-identity-coverage-under.patch === patching file src/backend/commands/publicationcmds.c Hunk #4 succeeded at 1243 (offset -9 lines). Hunk #5 succeeded at 2164 (offset 2 lines). Hunk #6 succeeded at 2287 (offset 2 lines). patching file src/backend/commands/tablecmds.c Hunk #1 FAILED at 62. Hunk #2 succeeded at 19163 (offset -35 lines). Hunk #3 succeeded at 19285 (offset -13 lines). Hunk #4 FAILED at 21009. 2 out of 4 hunks FAILED -- saving rejects to file src/backend/commands/tablecmds.c.rej patching file src/include/commands/publicationcmds.h patching file src/test/regress/expected/publication.out Hunk #1 succeeded at 2593 (offset 50 lines). patching file src/test/regress/sql/publication.sql Hunk #1 succeeded at 1592 (offset 40 lines). patching file src/test/subscription/t/039_partition_replica_identity.pl Unstaged changes after reset: M src/backend/commands/publicationcmds.c M src/backend/commands/tablecmds.c M src/include/commands/publicationcmds.h M src/test/regress/expected/publication.out M src/test/regress/sql/publication.sql M src/test/subscription/t/039_partition_replica_identity.pl Removing src/backend/commands/tablecmds.c.rej === using 'git apply' to apply patch ./v4-0002-Enforce-leaf-root-replica-identity-coverage-under.patch === Applied patch to 'src/backend/commands/publicationcmds.c' cleanly. Applied patch to 'src/backend/commands/tablecmds.c' with conflicts. Applied patch to 'src/include/commands/publicationcmds.h' cleanly. Applied patch to 'src/test/regress/expected/publication.out' cleanly. Applied patch to 'src/test/regress/sql/publication.sql' cleanly. Applied patch to 'src/test/subscription/t/039_partition_replica_identity.pl' cleanly. U src/backend/commands/tablecmds.c diff --cc src/backend/commands/tablecmds.c index 0274d892f2e,db96911a3b3..00000000000 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@@ -60,6 -61,8 +60,11 @@@ #include "commands/comment.h" #include "commands/defrem.h" #include "commands/event_trigger.h" ++<<<<<<< ours ++======= + #include "commands/extension.h" + #include "commands/publicationcmds.h" ++>>>>>>> theirs #include "commands/repack.h" #include "commands/sequence.h" #include "commands/tablecmds.h" @@@ -20957,6 -20979,50 +20966,53 @@@ QueuePartitionConstraintValidation(Lis } /* ++<<<<<<< ours ++======= + * attachPartitionTable: attach a new partition to the partitioned table + * + * wqueue: the ALTER TABLE work queue; can be NULL when not running as part + * of an ALTER TABLE sequence. + * rel: partitioned relation; + * attachrel: relation of attached partition; + * bound: bounds of attached relation. + */ + static void + attachPartitionTable(List **wqueue, Relation rel, Relation attachrel, PartitionBoundSpec *bound) + { + /* + * Create an inheritance; the relevant checks are performed inside the + * function. + */ + CreateInheritance(attachrel, rel, true); + + /* Update the pg_class entry. */ + StorePartitionBound(attachrel, rel, bound); + + /* Ensure there exists a correct set of indexes in the partition. */ + AttachPartitionEnsureIndexes(wqueue, rel, attachrel); + + /* and triggers */ + CloneRowTriggersToPartition(rel, attachrel); + + /* + * Clone foreign key constraints. Callee is responsible for setting up + * for phase 3 constraint verification. + */ + CloneForeignKeyConstraints(wqueue, rel, attachrel); + + /* + * If any ancestor (now reachable from attachrel through pg_inherits) is + * a publishing root in a publish_via_partition_root publication, every + * leaf under attachrel must have a replica identity that covers the + * ancestor's identity. Make the new inheritance row visible to syscache + * lookups before walking ancestors. + */ + CommandCounterIncrement(); + CheckPubViaRootLeafCoverageOfPublishingAncestors(attachrel); + } + + /* ++>>>>>>> theirs * ALTER TABLE ATTACH PARTITION FOR VALUES * * Return the address of the newly attached partition.