model-writtenrun 9060 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Raj Mohite reported that a statement_timeout setting followed by a sleeping CTE failed to cancel the query, apparently depending on quoted text, in #1.
- Tom Lane traced the behavior to sending multiple statements in one query string: PostgreSQL 10 generally retained the initial timeout, while newer versions inconsistently honored changes depending on whether a timeout was already active; he initially suggested restoring the older behavior in #2.
- Tatsuo Ishii instead proposed making SET statement_timeout affect subsequent statements immediately and supplied a patch with timing results in #4.
- Tom Lane accepted the more intuitive semantics but rejected the implementation because it repeatedly recalculated timeouts and complicated protocol handling; his replacement in #7 disables the timeout between statements so each receives a fresh timer.
- While reviewing the timeout handling, Tom Lane also identified fragile duplicated state and supplied a second patch in #7 making timeout.c the single source of truth through get_timeout_active().
- Tom Lane added documentation explaining simple-query and extended-protocol timeout behavior in #8; the thread ended with his proposal to proceed on the development branch only.
- The per-statement reset from #7 and documentation from #8 landed together as 2b2bacdca0, with a small wording edit and no backpatch because existing users might depend on the old behavior.
- The duplicate-state cleanup from #7 then landed unchanged as 22f6f2c1cc, completing the submitted replacement series; neither candidate has recorded backports.