model-writtenrun 8155 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Amit Langote opened this thread with a fix for Hao Wu's report from thread #42756: an insert waiting for concurrent ATTACH PARTITION could resume and place rows in a default partition whose constraint had changed, so the patch rechecked default constraints during tuple routing and added an isolation test #1; Amit identified PostgreSQL 12 as the first affected release #2.
- Alvaro Herrera raised direct insertion into a partitioned default partition and challenged the explanation of ExecInsert's checks #4 #5; Amit explained that checking during routing provides the parent partition metadata and covers nonleaf defaults that never reach ExecInsert #6.
- Testing differing column orders exposed a tuple-type error that Alvaro initially attributed to the minimally initialized ResultRelInfo #7; he supplied a workaround that used a zero range-table index and omitted tuple details from constraint errors #9.
- Alvaro then traced the problem to missing tuple-column conversion, superseding his ResultRelInfo workaround with a mapping proposal #10; Amit supplied a revised patch using existing partition slots, expanded tests for subpartitioned defaults and varying attribute numbers, and a PostgreSQL 12 variant #11.
- Alvaro revised the loop, comments, and slot-clearing order, and added a separate patch intended to avoid fetching attributes from virtual slots #13, then withdrew that virtual-slot diagnosis after recognizing that he had misread the code #14.
- Alvaro committed the routing portion of #13 as f481d28232, retaining its tests but restoring attribute mapping before clearing the previous slot and excluding the virtual-slot change; the fix was backpatched through PostgreSQL 12.
- Alvaro announced that the fix was pushed #15, and Amit acknowledged completion #16; the routing fix was landed and the separate virtual-slot proposal was abandoned.