model-writtenrun 2479 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Kirill Zdornyy reported that array_agg over anonymous records failed after upgrading to PostgreSQL 16, also reproduced on 17, when larger tables triggered partial aggregation #1.
- Richard Guo reproduced the failure with one row by lowering parallel-query costs and traced it to array_agg_deserialize passing an invalid typmod when receiving RECORD data #2.
- Tom Lane proposed disabling partial aggregation for anonymous records and attached a patch making agg_args_support_sendreceive reject RECORDOID because deserialization cannot supply the required typmod #3.
- David Rowley considered special-casing serialization and deserialization to carry the typmod, but judged that unattractive and endorsed Tom's fix #4.
- Tom committed the patch with added regression coverage as a7aa9f21f2, backpatched through PostgreSQL 16, and confirmed completion while explaining that the rarity of reports did not justify the complexity of retaining the optimization #5.