Re: SQL/PostgreSQL - Error observed in the QUERY not caught by the “EXCEPTION” block in the stored procedure - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: SQL/PostgreSQL - Error observed in the QUERY not caught by the “EXCEPTION” block in the stored procedure
Date
Msg-id CAKFQuwZymLZ-nCizM8G1GZTimaoVDJUvyrxT1muEpnQYHKgYtA@mail.gmail.com
Whole thread Raw
In response to Re: SQL/PostgreSQL - Error observed in the QUERY not caught by the “EXCEPTION” block in the stored procedure  (Eduardo Lúcio Amorim Costa <eduardolucioac@gmail.com>)
Responses Re: SQL/PostgreSQL - Error observed in the QUERY not caught by the “EXCEPTION” block in the stored procedure
List pgsql-bugs
On Sat, Jan 25, 2020 at 5:32 PM Eduardo Lúcio Amorim Costa <eduardolucioac@gmail.com> wrote:
Thanks for the suggestions! I found it a bit strange "pgsql" not to "understand" as an exception the "ERROR:  missing chunk number 0 for toast value 3483039 in pg_toast_3473493"

Please inline or bottom-post here.

I think Tom's point is that the function you wrote never actually attempted to print out the value of the field so the error never got triggered in the function.  You need to actually attempt to manipulate the data to get an error.  If you did get the function to actually encounter the error it should (haven't tested myself) be caught in the exception handler; i.e., "A more reliable way to trigger the problem is to do some computation
that requires the value of the field, perhaps along the lines of [query to try]".

David J.

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #16232: Database server connection limit exceeding
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #16230: Boolean column stick to "false" after callingupdateRow() on updateable ResultSet