=== Applying patches on top of PostgreSQL commit ID 88327092ff06c48676d2a603420089bf493770f3 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Thu Feb 12 11:34:22 UTC 2026 On branch cf/6449 nothing to commit, working tree clean === using 'git am' to apply patch ./0001-Fix-bug-19382-server-crash-when-ALTER-TYPE-is-used-m.patch === Applying: Fix (bug #19382) server crash when ALTER TYPE is used mid-transaction in PL/pgSQL Using index info to reconstruct a base tree... M src/pl/plpgsql/src/pl_exec.c Falling back to patching base and 3-way merge... Auto-merging src/pl/plpgsql/src/pl_exec.c CONFLICT (content): Merge conflict in src/pl/plpgsql/src/pl_exec.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 Fix (bug #19382) server crash when ALTER TYPE is used mid-transaction in PL/pgSQL 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". Unstaged changes after reset: M src/pl/plpgsql/src/pl_exec.c === using patch(1) to apply patch ./0001-Fix-bug-19382-server-crash-when-ALTER-TYPE-is-used-m.patch === patching file src/pl/plpgsql/src/pl_exec.c Hunk #1 succeeded at 469 (offset 11 lines). Hunk #2 FAILED at 3254. Hunk #3 succeeded at 3404 (offset -3 lines). Hunk #4 succeeded at 9127 (offset 217 lines). 1 out of 4 hunks FAILED -- saving rejects to file src/pl/plpgsql/src/pl_exec.c.rej Unstaged changes after reset: M src/pl/plpgsql/src/pl_exec.c Removing src/pl/plpgsql/src/pl_exec.c.rej === using 'git apply' to apply patch ./0001-Fix-bug-19382-server-crash-when-ALTER-TYPE-is-used-m.patch === Applied patch to 'src/pl/plpgsql/src/pl_exec.c' with conflicts. U src/pl/plpgsql/src/pl_exec.c diff --cc src/pl/plpgsql/src/pl_exec.c index 723048ab833,53add41882a..00000000000 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@@ -3255,14 -3247,37 +3258,40 @@@ exec_stmt_return(PLpgSQL_execstate *est } break; ++<<<<<<< ours ++======= + case PLPGSQL_DTYPE_REC: + { + PLpgSQL_rec *rec = (PLpgSQL_rec *) retvar; + + /* If record is empty, we return NULL not a row of nulls */ + if (rec->erh && !ExpandedRecordIsEmpty(rec->erh)) + { + /* + * Check if the record's composite type was altered since + * the record was populated. If so, convert the data to + * prevent crashes when outputting the record. + */ + if (rec->rectypeid != RECORDOID) + rec->erh = convert_record_for_altered_type(estate, + rec->erh, + rec->rectypeid); + estate->retval = ExpandedRecordGetDatum(rec->erh); + estate->retisnull = false; + estate->rettype = rec->rectypeid; + } + } + break; + ++>>>>>>> theirs case PLPGSQL_DTYPE_ROW: + case PLPGSQL_DTYPE_REC: { - PLpgSQL_row *row = (PLpgSQL_row *) retvar; + /* exec_eval_datum can handle these cases */ int32 rettypmod; - /* We get here if there are multiple OUT parameters */ exec_eval_datum(estate, - (PLpgSQL_datum *) row, + retvar, &estate->rettype, &rettypmod, &estate->retval,