model-writtenrun 5559 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Eisentraut opened the thread with a reproducer showing duplicated error text after server termination and argued for fixing libpq rather than adding a psql workaround #1; Fabien COELHO explained that the server FATAL and libpq's connection-loss detection are separate events #2.
- Peter explained why asynchronous callers must display both results #3, and Tom Lane proposed tracking already-returned text while preserving the complete PQerrorMessage buffer #5; Fabien preferred tolerating the corner case over adding complexity #6.
- Tom temporarily rejected text-offset tracking because discarded results might cause lost errors, then identified inconsistent pipeline reset placement #7; Alvaro Herrera agreed that centralizing resets in pqPipelineProcessQueue was reasonable #8.
- Tom resolved the lost-text concern by advancing the offset only when returning a result and deferring internally generated error results until pqPrepareAsyncResult, also adding a static out-of-memory result; his first patch depended on separately posted event-procedure changes #9.
- Andres Freund requested broader connection-termination testing and suggested a const-preserving comparison #10 #12, which Tom accepted #13; the patch landed as 618c16707a with additional guards protecting the static result from mutation or allocation.
- Tom posted the separate pipeline-reset cleanup and reported that check-world passed, while also considering accumulating errors across an entire pipeline #14; he abandoned that alternative to keep pipeline behavior consistent with sequential queries #15.
- Tom then found that query submission and other functions could clear errors still awaiting delivery, so he expanded the cleanup with command-queue guards #16; that version landed unchanged as b15f254466, with backpatching deferred because interactions with the earlier error-reporting change were uncertain.
- In May, Peter reran the original reproducer and found that a query attempted after connection loss inherited the previous query's errors #17; Tom traced this to a command queue left nonempty, which prevented the new reset guards from clearing the buffer #18.
- Tom moved command-queue disposal into pqDropConnection, reporting that the symptom disappeared and check-world passed #19; the final message still questioned whether emptying the whole queue and retaining pipelineStatus were correct.
- The final attachment subsequently landed unchanged as 93909599cd, completing all three changes represented by the candidates; its commit message again deferred backpatching, and the supplied thread contains no later discussion resolving the remaining cleanup questions.