model-writtenrun 6247 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Mathis Rudolf reported that a materialized-view column named mv made concurrent refresh fail with an ambiguous-column error, and proposed pg_internal_-prefixed internal aliases in #1.
- Bharath Rupireddy proposed generated names in #2 and random numbers in #4, while Bernd Helmle warned that variable names could turn predictable collisions into intermittent failures in #3; Michael Paquier preferred backend identifiers or PIDs over random numbers in #5.
- After Michael Paquier requested coverage of newdata, newdata2, and diff in #7, Bharath Rupireddy supplied PID-suffixed aliases in #8; Bernd Helmle accepted the PID choice and context-managed memory lifetime in #9, and Bharath added explanatory text and cosmetic cleanup in #10.
- Thomas Munro proposed _$-prefixed names and questioned numeric suffixes in #11, while Michael Paquier found the generated-name placeholders hard to read in #12; Bharath responded with directly embedded prefixes and PID interpolation in #13.
- Michael Paquier still found the repeated PID arguments cumbersome and recommended fixed _$ prefixes in #14, leading Bharath Rupireddy to remove dynamic naming and restore the existing temporary-table machinery in #15.
- Michael Paquier committed #15 unchanged as 187682c321 and confirmed backpatching in #16, accepting a very low collision probability rather than eliminating collisions entirely.
- While preparing release notes two months later, Tom Lane argued in #17 that alias.* syntax could eliminate ambiguity altogether, with composite-type casts preventing SELECT-list expansion; his replacement patch in #18 restored the original aliases and added regression cases deliberately matching every internal alias.
- Michael Paquier endorsed the replacement approach but favored delaying it past the imminent release preparation in #19; Tom Lane reported that the patch and test looked sound and favored prompt application to avoid documenting a partial fix in #20.
- The thread ended with Tom Lane planning to commit, and the following day 9179a82d7a landed #18 unchanged and was backpatched, superseding the prefix workaround with unambiguous SQL.