Re: WHEN SQLSTATE '00000' THEN equals to WHEN OTHERS THEN

2025-03-27 Thread Laurenz Albe
On Wed, 2025-03-19 at 15:03 +0100, David Fiedler wrote: > I've stumbled across a code that used this condition, resulting in unexpected > behavior. > I think it worths a note that catching 0 is not possible and that it > results in a catch all handler. > What do you think? Should I post the e

Re: WHEN SQLSTATE '00000' THEN equals to WHEN OTHERS THEN

2025-03-19 Thread Tom Lane
David Fiedler writes: > I've stumbled across a code that used this condition, resulting in > unexpected behavior. I think it worths a note that catching 0 is not > possible and that it results in a catch all handler. Hmph. The code thinks * OTHERS is represented as code 0 (which wo

WHEN SQLSTATE '00000' THEN equals to WHEN OTHERS THEN

2025-03-19 Thread David Fiedler
Hi, I've stumbled across a code that used this condition, resulting in unexpected behavior. I think it worths a note that catching 0 is not possible and that it results in a catch all handler. What do you think? Should I post the expected text somewhere? Thanks, David Fiedler -- *David Fied