Re: plpgsq_plugin's stmt_end() is not called when an error is caught - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: plpgsq_plugin's stmt_end() is not called when an error is caught
Date
Msg-id 20221215.165325.1960394123223420470.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: plpgsq_plugin's stmt_end() is not called when an error is caught  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: plpgsq_plugin's stmt_end() is not called when an error is caught
Re: plpgsq_plugin's stmt_end() is not called when an error is caught
List pgsql-hackers
At Thu, 15 Dec 2022 08:41:21 +0100, Pavel Stehule <pavel.stehule@gmail.com> wrote in
> čt 15. 12. 2022 v 8:25 odesílatel Masahiko Sawada <sawada.mshk@gmail.com>
> napsal:
> > Is this a bug in plpgsql?
> >
>
> I think it is by design.  There is not any callback that is called after an
> exception.
>
> It is true, so some callbacks on statement error and function's error can
> be nice. It can help me to implement profilers, or tracers more simply and
> more robustly.
>
> But I am not sure about performance impacts. This is on a critical path.

I didn't searched for, but I guess all of the end-side callback of all
begin-end type callbacks are not called on exception. Additional
PG_TRY level wouldn't be acceptable for performance reasons.

What we (pg_hint_plan people) want is any means to know that the
top-level function is exited, to reset function nest level. It would
be simpler than calling end callback at every nest level.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: plpgsq_plugin's stmt_end() is not called when an error is caught
Next
From: Pavel Stehule
Date:
Subject: Re: plpgsq_plugin's stmt_end() is not called when an error is caught