model-writtenrun 2052 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that preparing an empty statement with psql's \parse and then executing it triggers a PortalRunMulti assertion in #1.
- Tom Lane initially considered forbidding empty prepared statements in #2, then favored returning EXECUTE to preserve older behavior in #3; Aleksander Alekseev nevertheless submitted an empty-query rejection patch in #4.
- Tom Lane replaced rejection with a PortalRunMulti fallback in #6, then moved the substitution into ExecuteQuery in #7 because assigning EXECUTE in a general portal routine could be wrong for other callers.
- Tom Lane corrected the affected-version range to PostgreSQL 13 onward and confirmed that execution already succeeds when assertions are disabled in #8, strengthening the case against introducing an error.
- Michael Paquier traced command-tag initialization and proposed simply removing the assertion in #10; Tom Lane agreed in #11, and Alvaro Herrera supplied that replacement with simplified guards and a rewritten comment in #12.
- Tom Lane established that the outer EXECUTE portal supplies the tag after the empty inner portal returns, making the inner assertion invalid, and endorsed Alvaro's patch in #14; Michael Paquier explicitly approved its code in #15.
- Discussion settled on explaining the existing behavior without adding another assertion: Tom Lane clarified this in #16, explained parse-time versus run-time tags in #19, and supplied the final comment in #20.
- Alvaro Herrera committed #12 with that comment revision as 43cd859627, backpatched through PostgreSQL 13, and confirmed the push in the thread's final message #21; no attached work remained pending.
- On October 30, 2025, Alvaro Herrera committed the related ProcessQuery cleanup as a27c40bfe8, consolidating repeated completion-setting calls without an attached patch or a backpatch because the change was cosmetic.
- On January 30, 2026, Alvaro Herrera committed two further cosmetic corrections identified while reviewing the bug fix as e76221bd95: correcting the tag-initialization comment and using SetQueryCompletion in PortalDefineQuery, neither of which appeared in the attachments.