Re: alternative to PG_CATCH

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Subject: Re: alternative to PG_CATCH
Date: 2019-10-28 08:43:30
Message-ID: 95a822c3-728b-af0e-d7e5-71890507ae0c@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-12-14 16:49, Tom Lane wrote:
> I don't especially like the MACRO({...}) proposal, because it looks way
> too much like gcc's special syntax for "statement expressions". If we
> have to go this way, I'd rather see if MACRO((...)) can be made to work.
> But I question your assumption that we have to have two physical copies
> of the "finally" code. There's nothing wrong with implementing this
> sort of infrastructure with some goto's, or whatever else we have to
> have to make it work. Also, it'd look more natural as an extension
> to the existing PG_TRY infrastructure if the source code were like
>
> PG_TRY();
> {
> ...
> }
> PG_FINALLY();
> {
> ...
> }
> PG_END_TRY();

Here is a new implementation that works just like that.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v2-0001-PG_FINALLY.patch text/plain 29.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-10-28 09:01:42 Add const qualifiers to internal range type APIs
Previous Message Peter Eisentraut 2019-10-28 08:30:52 Re: base backup client as auxiliary backend process