model-writtenrun 259 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Qifan Liu reported that ANALYZE generated range statistics for a domain over int4multirange, but pg_restore_attribute_stats() rejected those same statistics, preventing faithful restoration #1.
- Michael Paquier proposed a shared helper that resolves domain base types for both attribute and expression statistics #3, while Corey Huinker independently submitted a fix with separate resolution logic in each path #4.
- Corey endorsed Michael's fix and negative tests, then confirmed that it already included clone comparisons #5 #7; Michael favored the shared helper because it avoided duplicated C logic #6.
- Jian He suggested obtaining domain base information through the type cache #8, prompting Michael to identify analogous failures for domains over tsvector #9 and rework restoration to pass base-type cache entries through the shared helpers #10.
- Manu verified that the revised patch passed regression tests on master and PostgreSQL 19, restored all 25 tested column and expression statistics faithfully, and supplied scripts and failure output demonstrating that the new tests detected the unfixed bugs #11.
- Manu also questioned why one rejected expression caused all expression statistics to be discarded #11; Corey explained the storage and NULL-handling constraints, leaving that behavior outside this fix #12.
- Corey supported the revised design while identifying custom statistic kinds as future work requiring additional infrastructure #13; the final thread message clarified that the PostgreSQL 18 backpatch could remain local to attribute_stats.c #14.
- After the thread's final message, Michael committed #10 with only comment, whitespace, and commit-message edits as 142fd8ff13, with backports through PostgreSQL 18, completing the domain-statistics fix.