=== Applying patches on top of PostgreSQL commit ID 6a857156827b6a938bd02b9bf7281e7b71dfd088 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Sep 4 12:37:40 UTC 2026 On branch cf/6887 nothing to commit, working tree clean === using 'git am' to apply patch ./v2-0001-Add-regression-test-to-highlight-unexpected-behav.patch === Applying: Add regression test to highlight unexpected behavior when running 'safe' alter column types on partitioned tables === using 'git am' to apply patch ./v2-0002-Skip-index-rewriting-when-possible-on-ALTER-TABLE.patch === Applying: Skip index rewriting when possible on ALTER TABLE ALTER COLUMN TYPE for partitioned tables error: sha1 information is lacking or useless (src/test/regress/expected/alter_table.out). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Skip index rewriting when possible on ALTER TABLE ALTER COLUMN TYPE for partitioned tables 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 ./v2-0002-Skip-index-rewriting-when-possible-on-ALTER-TABLE.patch === patching file src/backend/commands/tablecmds.c Hunk #1 succeeded at 155 (offset -2 lines). Hunk #2 FAILED at 690. Hunk #3 succeeded at 5383 (offset 1 line). Hunk #4 succeeded at 5410 (offset 1 line). Hunk #5 succeeded at 5425 (offset 1 line). Hunk #6 FAILED at 15705. Hunk #7 succeeded at 16294 (offset 414 lines). Hunk #8 succeeded at 16386 (offset 419 lines). Hunk #9 succeeded at 16397 (offset 419 lines). 2 out of 9 hunks FAILED -- saving rejects to file src/backend/commands/tablecmds.c.rej patching file src/test/regress/expected/alter_table.out patching file src/test/regress/sql/alter_table.sql Hunk #1 succeeded at 1532 (offset 2 lines). Unstaged changes after reset: M src/backend/commands/tablecmds.c M src/test/regress/expected/alter_table.out M src/test/regress/sql/alter_table.sql Removing src/backend/commands/tablecmds.c.rej === using 'git apply' to apply patch ./v2-0002-Skip-index-rewriting-when-possible-on-ALTER-TABLE.patch === /work/patches/./v2-0002-Skip-index-rewriting-when-possible-on-ALTER-TABLE.patch:108: trailing whitespace. * indexes and constraints that depend on the altered columns. We record the /work/patches/./v2-0002-Skip-index-rewriting-when-possible-on-ALTER-TABLE.patch:109: trailing whitespace. * objects that need to be deleted here, so they can be dropped by the caller /work/patches/./v2-0002-Skip-index-rewriting-when-possible-on-ALTER-TABLE.patch:170: trailing whitespace. * that we won't create duplicate indexes. We rely on postgres /work/patches/./v2-0002-Skip-index-rewriting-when-possible-on-ALTER-TABLE.patch:171: trailing whitespace. * automatically attaching existing child indexes to a new /work/patches/./v2-0002-Skip-index-rewriting-when-possible-on-ALTER-TABLE.patch:172: trailing whitespace. * partitioned index. Applied patch to 'src/backend/commands/tablecmds.c' with conflicts. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... U src/backend/commands/tablecmds.c warning: squelched 2 whitespace errors warning: 7 lines add whitespace errors. diff --cc src/backend/commands/tablecmds.c index fd144d783d9,c85463c4175..00000000000 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@@ -675,9 -690,8 +676,14 @@@ static void RememberWholeRowDependentFo static void RememberConstraintForRebuilding(Oid conoid, AlteredTableInfo *tab); static void RememberIndexForRebuilding(Oid indoid, AlteredTableInfo *tab); static void RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab); ++<<<<<<< ours +static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab, + LOCKMODE lockmode); +static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId, Oid ownerId, ++======= + static void ATPostAlterTypeCleanup(List **wqueue, ObjectAddresses *objects, AlteredTableInfo *tab, LOCKMODE lockmode); + static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId, ++>>>>>>> theirs char *cmd, List **wqueue, LOCKMODE lockmode, bool rewrite); static void RebuildConstraintComment(AlteredTableInfo *tab, AlterTablePass pass, @@@ -16096,26 -15704,18 +16122,19 @@@ RememberStatisticsForRebuilding(Oid stx /* * Cleanup after we've finished all the ALTER TYPE or SET EXPRESSION * operations for a particular relation. We have to drop and recreate all the - * indexes and constraints that depend on the altered columns. We do the - * actual dropping here, but re-creation is managed by adding work queue - * entries to do those steps later. + * indexes and constraints that depend on the altered columns. We record the + * objects that need to be deleted here, so they can be dropped by the caller + * in one go after this method has been called for each table. The re-creation, + * however, is managed by adding work queue entries to do those steps later. */ static void - ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab, LOCKMODE lockmode) + ATPostAlterTypeCleanup(List **wqueue, ObjectAddresses *objects, AlteredTableInfo *tab, LOCKMODE lockmode) { ObjectAddress obj; - ObjectAddresses *objects; ListCell *def_item; ListCell *oid_item; + ListCell *owner_item; - /* - * Collect all the constraints and indexes to drop so we can process them - * in a single call. That way we don't have to worry about dependencies - * among them. - */ - objects = new_object_addresses(); - /* * Re-parse the index and constraint definitions, and attach them to the * appropriate work queue entries. We do this before dropping because in