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

From: Eduardo Lúcio Amorim Costa <eduardolucioac(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: SQL/PostgreSQL - Error observed in the QUERY not caught by the “EXCEPTION” block in the stored procedure
Date: 2020-01-26 20:43:55
Message-ID: CAN+8gCgDyE-M-W=vhMEKcRMs_dOVR3djgHs9Ee9kLTynpw65hg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Gentlemen,

I found your answers very useful, so I took the liberty of publishing them
on the thread I opened about the problem on the internet (
https://stackoverflow.com/a/59922553/3223785 ).

If you do not want this content to continue to be published, please let me
know so I can delete it.

Thanks! =D

Em dom., 26 de jan. de 2020 às 03:54, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> escreveu:

> On Sat, Jan 25, 2020 at 5:32 PM Eduardo Lúcio Amorim Costa <
> eduardolucioac(at)gmail(dot)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.
>
>

--
*Eduardo Lúcio*
LightBase Consultoria em Software Público
eduardo(dot)lucio(at)LightBase(dot)com(dot)br
*+55-61-3347-1949 - http://brlight.org <http://brlight.org/> - Brasil-DF*
*Software livre! Abrace essa idéia!*
*"Aqueles que negam liberdade aos outros não a merecem para si mesmos."*

*Abraham Lincoln*

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Johann du Toit 2020-01-27 00:57:39 Re: BUG #16233: Yet another "logical replication worker" was terminated by signal 11: Segmentation fault
Previous Message Tom Lane 2020-01-26 18:26:33 Re: Segfault on updating foreign table