model-writtenrun 4535 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Atish Prakash reported lost range and array statistics after dump/restore or upgrade, including rejection of empty arrays and a distinct older-version NULL histogram case, with examples showing changed estimates #1.
- Corey Huinker linked the report to the related extended-statistics bug and proposed fixing attribute restoration first; his initial patch allowed empty arrays broadly and guarded array-length accesses #2 #3.
- Michael Paquier demonstrated that allowing empty numeric arrays caused out-of-bounds reads in get_attstatsslot(), then supplied a replacement permitting empty values only for range_length_histogram and most_common_elems while retaining stricter validation elsewhere #5.
- Corey accepted the narrower design, requested warning text that reflects whether emptiness is allowed, and planned to adapt the extended-statistics work; Michael agreed to adjust the diagnostics before committing #6 #7.
- Michael committed #5 as 2656f66461 with the diagnostic adjustment and an additional regression test, backpatching to PostgreSQL 19 because that version introduced the relevant empty-array representations #8.
- After landing, Michael identified the remaining PostgreSQL 17/18 case where range_empty_frac exists alongside a NULL histogram and suggested possible dump-side conversion to an empty array; Corey noted that this would leave existing dumps unfixed and reported that the committed change looked good on both branches #8 #9 #10.
- The thread ended with the empty-array fix landed on development and PostgreSQL 19, Michael opposing permanent restore-side acceptance of the older NULL combination, and Corey planning a PostgreSQL 18-specific pg_dump fix as an additional patch in the other thread, where extended-statistics work would also continue #11 #12 #13.