model-writtenrun 4484 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Dec 2022 - Jan 2023 · 2 entries
- Corey Huinker began with CAST error/default clauses implemented through an error-testing CoalesceExpr and safe input helpers; array-to-array casts, domains, JIT, documentation, and FORMAT support were unfinished #1.
- Tom Lane objected to extending standard CAST syntax before the SQL committee settled it, and Vik Fearing agreed to wait; the work was consequently deferred rather than included in PostgreSQL 16 #2 #7 #8 #11.
Jul - Aug 2025 · 4 entries
- After more than two years, jian he revived the proposal using existing executor error contexts and a dedicated SafeTypeCastExpr, with array and domain support #13.
- Vik Fearing confirmed that the feature had entered the developing standard and clarified ON CONVERSION ERROR syntax, whole-array fallback, and the requirement that failures in the default expression still raise errors; FORMAT remained separate #14 #16 #17 #21 #22.
- Corey Huinker identified that replacing cast functions with input/output conversion could change rounding semantics, leading jian he to make numeric cast functions error-safe and retain FuncExpr evaluation for them #23 #24.
- Corey then explained that extension casts also needed an explicit safety distinction, prompting a broad conversion of built-in cast functions and the proposed pg_cast.casterrorsafe flag #26 #28 #29.
Oct 2025 - Jan 2026 · 6 entries
- The October expansion added bit and geometry conversions, early safe constant evaluation, and additional tests, while money conversions and the SQL-language circle-to-polygon cast remained difficult cases #30 #32.
- Corey reviewed the organization and diagnostics and tested deliberately failing user functions, while Amul Sul proposed ereturn usage and wrappers around shared helpers to avoid duplicated implementations #33 #36 #37 #40.
- Jian incorporated those reviews, simplified executor handling, and revised floating-point error helpers; Amul subsequently pushed for reusing existing coercion infrastructure and avoiding unnecessary geometry helper variants #41 #45 #46.
- The resulting revision temporarily removed pg_cast.casterrorsafe and introduced extended coercion APIs, then restored the flag in a separate CREATE CAST WITH SAFE FUNCTION patch supporting extension casts #47 #49.
- Amul's January review led to consolidating raw parsing into TypeCast and transformTypeCast and passing error contexts into executor initialization, while the dedicated transformed SafeTypeCastExpr remained to carry the fallback expression #53 #54 #57.
- Corey supported retaining separate safe execution machinery to avoid imposing overhead on ordinary casts, and later kept IS CASTABLE AS outside this series as a separate feature #55 #58 #59.
Mar - Apr 2026 · 14 entries
- The March review round fixed an executor compilation error, gained Corey's approval, and then added recursive eligibility checks for nested domains and arrays #63 #64 #65 #66.
- Jian added per-FuncExpr safety marking, incorporated JIT help credited to Matheus Alcantara, and then introduced soft-error-aware constant folding because skipping cast subtrees left CollateExpr nodes unprocessed #68 #69.
- Peter Eisentraut committed the straightforward built-in cast conversions from #69 as e2f289e5b9, deliberately retaining hard errors for missing compiled-in XML support and deferring dtof changes #70.
- Peter requested safer return conventions for JSONB and floating-point helpers, suggested replacing the circle-to-polygon SQL wrapper with C, and explained how integer-to-money overflow could be checked directly #70.
- Peter also opposed CREATE CAST WITH SAFE FUNCTION because of standard-syntax and extension-upgrade concerns, suggesting a conversion-probing function as an incremental alternative; Corey recognized the connection to IS CASTABLE AS #70 #71.
- Jian resent nine remaining patches, revised the JSONB and float APIs, added circle-to-polygon and money conversions, and dropped the separate user-defined SAFE-cast patch while retaining eligibility checks #72.
- Nested-cast testing exposed excessive softening of source-expression errors and an array-folding crash; the next revision removed FuncExpr.errorsafe and reworked parser and executor handling, leaving source-error semantics unsettled #73 #75.
- The JSONB member of #75 landed unchanged as 10e4d8aaf4, using a Datum-returning error helper and direct caller returns.
- The float and geometry prerequisites from #75 landed together as 45cdaf3665, with revised helper return conventions and the previously deferred dtof handling.
- The circle-to-polygon member of #75 landed as 26f9012bee, with a pointer-returning shared C helper and a catalog-version bump.
- The money member of #75 landed unchanged as b36b956404, supporting integer, bigint, and numeric inputs while leaving money-to-numeric conversion unsafe.
- Peter announced that only text-to-regclass support and the main CAST feature remained; jian's remainder fixed Amul's diagnostic findings and an aggregate crash caused by processing duplicated source expressions #76 #77 #78.
- A follow-up restored correct deparsing while avoiding duplicate aggregate traversal, and jian incorporated Amul's off-list parser and documentation fixup into a complete revised series, also attaching the fixup separately #79 #80.
- Vik's standards correction removed the standalone NULL ON CONVERSION ERROR form in favor of DEFAULT NULL, and Corey reported that the revised remaining patches still passed his checks #84 #85 #86.
Jun - Jul 2026 · 4 entries
- After another gap, jian rebased the remaining work and reopened policy choices for user-defined casts, while Corey reiterated that source-expression errors should escape and unsafe conversion functions should be identified explicitly #87 #88.
- Henson Choi proposed treating error safety as a function property and tested text-to-regclass conversion, finding that missing schemas raised hard errors while missing relations were handled softly #89 #90.
- Jian adopted pg_proc.proerrorsafe with CREATE FUNCTION ERROR SAFE/UNSAFE, used it to check conversion capabilities, and revised the text-to-regclass patch in response to Henson's report #94.
- Further July revisions improved COLLATE handling and documentation, while Corey supported the function attribute but requested wording that distinguished soft-error capability from a guarantee that every failure could be caught #95 #96.
Sep - Nov 2026 · 6 entries
- The September rework moved parser error context into ParseState, replaced duplicated source subtrees with a CaseTestExpr placeholder, and added safe function-call opcodes so dummy results after soft errors could not be consumed as valid pointers #97.
- Corey's October review accepted much of the function-attribute and executor work but found that inner domain casts were being softened incorrectly and questioned restrictions on subqueries in defaults #98.
- Jian's next submission permitted aggregates, windows, and subqueries in defaults and added arg_errorsafe to distinguish array-constructor coercions from ordinary source evaluation, while array/source error boundaries remained under discussion #99.
- Corey argued that even a conversion known to fail must preserve errors from evaluating its source expression, reported uninitialized collation-state warnings, and questioned whether the executor's no-conversion path discarded captured errors #100.
- Corey then supplied the complete series with two additional LLM-generated WIP patches: one moved safe-cast nodes into the appropriate collation-processing switch, and the other added a no_eval constant-folding mode and regression tests to preserve source errors and avoid evaluating unused defaults #101.
- Text-to-regclass support, function safety metadata, and CAST fallback syntax remain under review; Corey reported that the WIP fixes resolved his behavioral examples but requested scrutiny of the generated code, the no_eval approach, and whether the proposed evaluation semantics match the intended standard behavior #101.