model-writtenrun 6139 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Chunling Qin reported that restoring ANALYZE-produced range-expression statistics could fail and lose statistics when too few non-empty ranges were sampled, supplying a reproduction in #1.
- Michael Paquier demonstrated the related attribute-statistics failure and proposed allowing empty arrays selectively in the restore helpers in #2; Corey Huinker also identified that range_bounds_histogram must be validated independently because it occupies a separate statistics slot in #3.
- Corey submitted three patches in #5, separating the attribute-statistics fix, range-bounds decoupling, and extended-statistics empty-array support because the attribute case required an older backpatch target.
- Michael moved the attribute-statistics review to the related bug thread in #6 and subsequently requested that the remaining work follow the newly committed attribute-statistics implementation in #7.
- Corey's revised series in #8 removed the superseded attribute patch, preserved range-bounds decoupling, and adapted the extended-statistics helper to accept empty arrays only for range_length_histogram and most_common_elems; the latter patch credited both Corey and Michael as authors.
- The revised submission #8 also added pg_dump conversion of older servers' mismatched NULL value arrays to empty arrays; Corey reported testing against version 18 but could not construct the corresponding extended-expression most_common_elems case.
- Michael committed range-bounds decoupling from #8 as 13eb56409f, with comment and regression-test adjustments, and committed selective empty-array support as 87524d0dd8, with documented helper behavior and reorganized, expanded tests.
- Michael confirmed both fixes were backpatched through version 19 in #9, while deferring the pg_dump compatibility patch and additional multidimensional-input testing; he noted that upgrades from versions 17 and 18 could still lose some statistics until the compatibility fix landed.
- Corey agreed that the remaining pg_dump patch could wait in #10, leaving the two restore fixes committed and older-source dump compatibility pending.