model-writtenrun 58 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alperen Keles reported that sorted GROUPING SETS could return a column's original value where NULL was required, tracing the failure to additional tuple deformation overwriting manually adjusted null flags in #1.
- Ayush Tiwari reproduced the bug and found that fetching all attributes first fixed it, but questioned the cost of fetching unnecessary columns in #2; David Rowley began investigating and added it to the PostgreSQL 19 open items in #3.
- David considered changing null-bitmap deformation or tracking required attributes through ExprState, then posted #4, which instead reused nodeAgg.c's existing column-discovery code to fetch all required attributes before inserting NULLs; he accepted possible extra work before HAVING filtering and included a regression test.
- Ayush approved the patch and suggested limiting the new initialization block to grouping sets in #5.
- David committed #4 as 93ec486803, adding an all_grouped_cols guard and refining comments and the commit message; the fix was backpatched through PostgreSQL 19, and his closing message #6 confirmed the push with no further work outstanding.