=== Applying patches on top of PostgreSQL commit ID f68727292ae2e5dcce7d439a897b5dd96c4414c0 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Thu Dec 3 03:24:36 UTC 2026 On branch cf/7634 nothing to commit, working tree clean === using 'git am' to apply patch ./v3-0001-Ignore-invalid-leaf-indexes-on-partitions-during-.patch === Applying: Ignore invalid leaf indexes on partitions during CREATE INDEX Using index info to reconstruct a base tree... M src/backend/commands/indexcmds.c M src/test/regress/expected/indexing.out Falling back to patching base and 3-way merge... Auto-merging src/test/regress/expected/indexing.out Auto-merging src/backend/commands/indexcmds.c CONFLICT (content): Merge conflict in src/backend/commands/indexcmds.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 Ignore invalid leaf indexes on partitions during CREATE INDEX 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 ./v3-0001-Ignore-invalid-leaf-indexes-on-partitions-during-.patch === patching file doc/src/sgml/ref/create_index.sgml patching file src/backend/commands/indexcmds.c Hunk #1 FAILED at 1458. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/commands/indexcmds.c.rej patching file src/test/regress/expected/indexing.out patching file src/test/regress/sql/indexing.sql Unstaged changes after reset: M doc/src/sgml/ref/create_index.sgml M src/test/regress/expected/indexing.out M src/test/regress/sql/indexing.sql Removing src/backend/commands/indexcmds.c.rej === using 'git apply' to apply patch ./v3-0001-Ignore-invalid-leaf-indexes-on-partitions-during-.patch === Applied patch to 'doc/src/sgml/ref/create_index.sgml' cleanly. Applied patch to 'src/backend/commands/indexcmds.c' with conflicts. Applied patch to 'src/test/regress/expected/indexing.out' cleanly. Applied patch to 'src/test/regress/sql/indexing.sql' cleanly. U src/backend/commands/indexcmds.c diff --cc src/backend/commands/indexcmds.c index 0f2e9c3dd74,f9a46fadea1..00000000000 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@@ -1477,17 -1460,13 +1477,27 @@@ DefineIndex(ParseState *pstate cldidx = index_open(cldidxid, lockmode); /* ++<<<<<<< ours + * Now that we hold the lock, recheck the condition in + * case the index was concurrently attached to some other + * parent index while we waited. + * + * The unlocked check above cannot give a stale true + * answer, because the lock we hold on the partition + * prevents detaching it or dropping the parent index; it + * only serves to avoid locking indexes we were going to + * skip anyway. + */ + if (has_superclass(cldidxid)) ++======= + * Can't use an invalid regular index (e.g., left behind + * by a failed CREATE INDEX CONCURRENTLY). Partitioned + * indexes made with ON ONLY are invalid until their + * partitions are attached, so we still allow those. + */ + if (cldidx->rd_rel->relkind != RELKIND_PARTITIONED_INDEX && + !cldidx->rd_index->indisvalid) ++>>>>>>> theirs { index_close(cldidx, lockmode); continue;