model-writtenrun 7589 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sait Talha Nisanci reported crashes caused by NULL tuple descriptors left in the record cache after errors, reproduced the failure through error injection, and proposed delaying hash insertion in #1.
- Sait's initial patch #2 used HASH_FIND before preparing the tuple descriptor and deferred HASH_ENTER until the descriptor was valid.
- Tom Lane questioned the extra hash lookup and proposed tolerating NULL descriptors in the comparator in #3; Andres Freund argued that this could accumulate unreachable entries in #4, and Tom accepted following the existing separate-lookup-and-insertion pattern in #5.
- Andres identified a potential memory leak if cache-array allocation failed after copying the tuple descriptor in #6, and Sait revised the patch to allocate array space before the copy in #7.
- Jeff Davis committed the revised patch as dd0e37cc15, additionally delaying NextRecordTypmod advancement until allocation succeeded and placing hash insertion after identifier initialization; the commit specifies backpatching through PostgreSQL 11, and Jeff's confirmation in #8 closes the thread with the fix landed.