model-writtenrun 9421 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Colm McHugh reported a HashAggregate array overrun caused by duplicate grouping columns and supplied a patch that sizes the array from grouping entries plus distinct remaining columns, with SELECT and DELETE regression cases #1.
- Tom Lane reproduced the memory-overwrite warnings on HEAD and asked Andrew Gierth to investigate the fix #2.
- Andrew Gierth traced the problem to duplicate keys reaching HashAggregate through Unique paths and initially proposed removing duplicates in the planner #4; Tom Lane requested defensive executor checks #5, which Andrew agreed to add #6.
- Andrew Gierth abandoned planner deduplication because cross-type comparisons could require different hash functions for the same column, then posted a replacement executor patch using a safe allocation upper bound and retaining the SELECT regression case #7.
- The thread ends with Andrew Gierth's stated intention to commit #7; the subsequent commit applies that patch unchanged and records backpatching to PostgreSQL 10, completing the fix 44e95b5728.