=== Applying patches on top of PostgreSQL commit ID 972c14fb9134fdfd76ea6ebcf98a55a945bbc988 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Apr 15 02:11:25 UTC 2026 On branch cf/6094 nothing to commit, working tree clean === using 'git am' to apply patch ./v1-0001-Allow-virtual-columns-in-index-expressions-or-pre.patch === Applying: Allow virtual columns in index expressions or predicate Using index info to reconstruct a base tree... M src/backend/commands/indexcmds.c M src/test/regress/expected/generated_virtual.out M src/test/regress/sql/generated_virtual.sql Falling back to patching base and 3-way merge... Auto-merging src/test/regress/sql/generated_virtual.sql Auto-merging src/test/regress/expected/generated_virtual.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 Allow virtual columns in index expressions or predicate 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-Allow-virtual-columns-in-index-expressions-or-pre.patch === patching file src/backend/commands/indexcmds.c Hunk #1 succeeded at 54 (offset 1 line). Hunk #2 succeeded at 1106 (offset 8 lines). Hunk #3 succeeded at 1135 (offset 9 lines). Hunk #4 FAILED at 1143. 1 out of 4 hunks FAILED -- saving rejects to file src/backend/commands/indexcmds.c.rej patching file src/test/regress/expected/generated_virtual.out Hunk #1 succeeded at 768 (offset 27 lines). Hunk #2 succeeded at 819 (offset 27 lines). patching file src/test/regress/sql/generated_virtual.sql Hunk #1 succeeded at 403 (offset 9 lines). Hunk #2 succeeded at 425 (offset 9 lines). Unstaged changes after reset: M src/backend/commands/indexcmds.c M src/test/regress/expected/generated_virtual.out M src/test/regress/sql/generated_virtual.sql Removing src/backend/commands/indexcmds.c.rej === using 'git apply' to apply patch ./v1-0001-Allow-virtual-columns-in-index-expressions-or-pre.patch === Applied patch to 'src/backend/commands/indexcmds.c' with conflicts. Applied patch to 'src/test/regress/expected/generated_virtual.out' cleanly. Applied patch to 'src/test/regress/sql/generated_virtual.sql' cleanly. U src/backend/commands/indexcmds.c diff --cc src/backend/commands/indexcmds.c index 9ab74c8df0a,f269cd20227..00000000000 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@@ -1154,27 -1143,20 +1152,42 @@@ DefineIndex(ParseState *pstate (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("index creation on system columns is not supported"))); } ++<<<<<<< ours + + /* + * XXX Virtual generated columns in index expressions or predicates + * could be supported, but it needs support in + * RelationGetIndexExpressions() and RelationGetIndexPredicate(). + */ + j = -1; + while ((j = bms_next_member(indexattrs, j)) >= 0) + { + AttrNumber attno = j + FirstLowInvalidHeapAttributeNumber; + + if (attno > 0 && + TupleDescAttr(RelationGetDescr(rel), attno - 1)->attgenerated == ATTRIBUTE_GENERATED_VIRTUAL) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + stmt->isconstraint ? + errmsg("unique constraints on virtual generated columns are not supported") : + errmsg("indexes on virtual generated columns are not supported"))); + } ++======= ++>>>>>>> theirs } + /* + * Expand virtual generated columns in expressions or predicates. + */ + if (indexInfo->ii_Expressions) + indexInfo->ii_Expressions = (List *) + expand_generated_columns_in_expr((Node *) indexInfo->ii_Expressions, + rel, 1); + if (indexInfo->ii_Predicate) + indexInfo->ii_Predicate = (List *) + expand_generated_columns_in_expr((Node *) indexInfo->ii_Predicate, + rel, 1); + /* Is index safe for others to ignore? See set_indexsafe_procflags() */ safe_index = indexInfo->ii_Expressions == NIL && indexInfo->ii_Predicate == NIL;