=== Applying patches on top of PostgreSQL commit ID 9018c7d37bb464cd53567c0b553a6f49b50bec78 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sun Apr 19 12:51:29 UTC 2026 On branch cf/4337 nothing to commit, working tree clean === using 'git am' to apply patch ./v36-0001-IMMV-Parser-support.patch === Applying: IMMV Parser support === using 'git am' to apply patch ./v36-0002-IMMV-relisivm-column-in-pg_class-system-catalog.patch === Applying: IMMV relisivm column in pg_class system catalog === using 'git am' to apply patch ./v36-0003-IMMV-Long-life-to-transition-tables.patch === Applying: IMMV Long life to transition tables Using index info to reconstruct a base tree... M src/backend/commands/trigger.c M src/include/commands/trigger.h Falling back to patching base and 3-way merge... Auto-merging src/include/commands/trigger.h Auto-merging src/backend/commands/trigger.c CONFLICT (content): Merge conflict in src/backend/commands/trigger.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 IMMV Long life to transition 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 ./v36-0003-IMMV-Long-life-to-transition-tables.patch === patching file src/backend/commands/trigger.c Hunk #1 succeeded at 3819 (offset 2 lines). Hunk #2 succeeded at 3888 (offset 2 lines). Hunk #3 succeeded at 3937 (offset 15 lines). Hunk #4 succeeded at 3984 (offset 22 lines). Hunk #5 succeeded at 4880 (offset 23 lines). Hunk #6 succeeded at 5470 with fuzz 2 (offset 337 lines). Hunk #7 FAILED at 5294. Hunk #8 FAILED at 5315. 2 out of 8 hunks FAILED -- saving rejects to file src/backend/commands/trigger.c.rej patching file src/include/commands/trigger.h Unstaged changes after reset: M src/backend/commands/trigger.c M src/include/commands/trigger.h Removing src/backend/commands/trigger.c.rej === using 'git apply' to apply patch ./v36-0003-IMMV-Long-life-to-transition-tables.patch === Applied patch to 'src/backend/commands/trigger.c' with conflicts. Applied patch to 'src/include/commands/trigger.h' cleanly. U src/backend/commands/trigger.c diff --cc src/backend/commands/trigger.c index da0d1ba6791,cbbe7dd547a..00000000000 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@@ -5110,9 -5133,7 +5156,13 @@@ AfterTriggerBeginXact(void */ afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */ afterTriggers.query_depth = -1; ++<<<<<<< ours + afterTriggers.firing_depth = 0; + afterTriggers.batch_callbacks = NIL; + afterTriggers.firing_batch_callbacks = false; ++======= + afterTriggers.prolonged_tuplestores = NIL; ++>>>>>>> theirs /* * Verify that there is no leftover state remaining. If these assertions @@@ -5304,8 -5316,33 +5354,38 @@@ AfterTriggerFreeQuery(AfterTriggersQuer qs->tables = NIL; list_free_deep(tables); ++<<<<<<< ours + list_free_deep(qs->batch_callbacks); + qs->batch_callbacks = NIL; ++======= + /* Release prolonged tuplestores at the end of the outmost query */ + if (afterTriggers.query_depth == 0) + { + foreach(lc, afterTriggers.prolonged_tuplestores) + { + ts = (Tuplestorestate *) lfirst(lc); + if (ts) + tuplestore_end(ts); + } + afterTriggers.prolonged_tuplestores = NIL; + } + } + + /* + * Release the tuplestore, or append it to the prolonged tuplestores list. + */ + static void + release_or_prolong_tuplestore(Tuplestorestate *ts, bool prolonged) + { + if (prolonged && afterTriggers.query_depth > 0) + { + MemoryContext oldcxt = MemoryContextSwitchTo(CurTransactionContext); + afterTriggers.prolonged_tuplestores = lappend(afterTriggers.prolonged_tuplestores, ts); + MemoryContextSwitchTo(oldcxt); + } + else + tuplestore_end(ts); ++>>>>>>> theirs }