model-writtenrun 2431 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Fiedler reported that WHEN SQLSTATE '00000' unexpectedly acted as a catchall handler and suggested documenting the behavior #1.
- Tom Lane identified the internal representation of OTHERS as zero as the cause and proposed fixing the collision by using -1, which MAKE_SQLSTATE cannot generate #2.
- Laurenz Albe demonstrated that users can explicitly raise an exception with SQLSTATE '00000', establishing that this code can occur in an exception #3.
- Tom Lane submitted the patch using a named PLPGSQL_OTHERS constant and asked whether existing reliance on the catchall behavior made backpatching undesirable; this remained open at the thread's last message #4.
- Tom Lane subsequently committed the patch unchanged as 58fdca2204, with the commit message explaining that it would not be backpatched because changing the behavior in a minor release could disrupt existing code.