model-writtenrun 9484 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jianing Yang reported that changing a varchar column's length and then dropping its partitioned table crashed PostgreSQL 11 and prevented recovery #1; Michael Paquier reproduced the failure on PostgreSQL 11 but not HEAD #2.
- Amit Langote traced the corruption to child indexes receiving the parent's relfilenode #3 and explained that clearing oldNode would prevent corruption, while preserving each child's storage required changing cleanup ordering #4.
- Amit proposed separating cleanup preparation from deletion so child indexes could retain their own storage, but described the patch as a rough sketch that failed regression tests #5; he later resent it unchanged for open-item tracking #6.
- Tom Lane proposed a smaller partitioned-index storage-reuse guard and deferred the broader rewrite, noting that parent comments still propagated incorrectly to child indexes #10; Amit demonstrated that this also overwrote existing child comments #11.
- Tom moved the guard into TryReuseIndex and added defensive clearing of child statement fields, supplying HEAD and PostgreSQL 11 patches #12; he also questioned the existing storage-preservation mechanism and suggested retaining compatible indexes or exchanging storage between live indexes.
- After discussing the distinct purposes of CheckIndexCompatible and CompareIndexInfo #13, Amit supplied a broader redesign that retained compatible indexes without dropping them and preserved inherited constraint comments, although rebuilt child indexes still lost their comments #14.
- Alvaro Herrera tested the redesign and found locale-dependent regression output #15, prompting Amit's test-only revision #17; Alvaro subsequently reported that intervening changes prevented that revision from applying #18.
- Tom identified a correctness concern with retaining indexes unchanged: widening a varchar column could leave the index's declared type modifier stale #19.
- Tom committed the stopgap from #12 as c01eb619a8, adding regression tests based on Amit's work that deliberately recorded the remaining incorrect comment and index-reuse behavior, and announced the landing in #20.
- At the thread's end, Amit confirmed the stale-metadata problem and suggested updating index pg_attribute entries directly #21; the corruption fix had landed, while the broader index-reuse and comment-preservation redesign remained unresolved.