model-writtenrun 4017 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- amutu reported that a zero-row \gset left ROW_COUNT unset or retaining an earlier query's count, contrary to the documented behavior #1.
- Japin Li submitted a patch making psql update result variables even after result processing failed #2, and Jov confirmed that it fixed the reported problem #3.
- Michael Paquier agreed that SetResultVariables() should run in this case, citing its documentation and analogous handling of backend and internal psql errors #4.
- Tom Lane approved the approach, supplied a corrected comment, and questioned backpatching because scripts might depend on the old behavior #5.
- Michael favored a development-branch-only fix to avoid disrupting scripts in a minor release #6, and Tom agreed to wait briefly for objections #7.
- Michael committed 2940f1c837 from #2, retaining its logic while updating the comment and adding regression coverage; his final message confirmed application to HEAD with no backpatch #8.