model-writtenrun 3542 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that an immutable PARALLEL UNSAFE function containing an EXCEPTION block caused parallel index creation to fail because workers cannot start subtransactions, with reproduction across supported branches and master #1.
- Tender Wang traced the failure to constant folding hiding the function from is_parallel_safe() and proposed checking raw expressions #2; his first patch added boolean options to the relcache accessors while leaving incorrectly declared PARALLEL SAFE functions outside its scope #3.
- Jian He simplified the regression setup to force parallel workers without inserting 300000 rows #4, withdrew an incorrect concern about safe functions #6, and suggested clearer argument naming #7; Tender incorporated these changes in #8.
- Jian He supplied a follow-up adjustment to comments and boolean polarity and said the revised patch looked good #9, but Michael Paquier rejected the underlying API because cached flattened expressions could still be returned and optional flattening invited future misuse #10.
- Tender accepted direct syscache retrieval #12 and replaced the boolean API with a generic raw-clause helper in #13; Jian proposed separate expression and predicate helpers #14, while Michael required avoiding relcache entirely and placing the helpers in lsyscache.c #15.
- Tender implemented the two syscache helpers and explanatory planner comment in #16, which Michael committed as eae7be600b with light naming, formatting, and comment edits and backpatches through PostgreSQL 12.
- Tender noticed a comment typo after the commit #17, but Tom Lane's subsequent review challenged the entire approach: raw trees omit processing such as default-argument insertion, and ignoring successful constant folding conflicts with established planner behavior #18.
- Tom recommended reverting and pursuing separate work to permit exception-using functions in parallel workers; he identified sending already-processed expression trees to workers as the more general solution, while considering backpatching the exception work too risky and blanket restrictions on unsafe index functions too disruptive #18.
- Michael defended respecting function safety markings but accepted reverting on all branches #19, and Tom reiterated that a general solution would require serializing already-folded expression trees rather than having workers recreate them #20.
- Michael reverted the entire fix with 099ca50bd4 and confirmed that outcome in #21; the thread ends with the original issue unfixed and broader expression-transfer work deferred pending a compelling use case.