model-writtenrun 3324 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that CREATE TABLE LIKE copied invalid attribute references into expression statistics when the source table contained a dropped column, while expression indexes were copied correctly #1.
- Tender Wang reproduced the bug on HEAD and traced it to expression statistics support #2, then suggested repairing attribute numbers in transformExtendedStatistics #3.
- Tom Lane explained that the column mapping was unavailable at that stage and proposed delaying statistics cloning until expandTableLikeClause, where map_variable_attnos could adjust expressions #4; Tender Wang agreed with that approach #5.
- Tom Lane posted the implementation and regression test, removed the now-unused transformExtendedStatistics machinery, and planned to wait until after the beta1 freeze before committing #6.
- The thread ended with Tender Wang's positive review #7; the patch subsequently landed unchanged on May 22 as 5278668d7a, with backpatching through PostgreSQL 14, including 1015162c35, leaving no outstanding patch work.