Re: alternative to PG_CATCH - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: alternative to PG_CATCH
Date
Msg-id 95a822c3-728b-af0e-d7e5-71890507ae0c@2ndquadrant.com
Whole thread Raw
In response to Re: alternative to PG_CATCH  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: alternative to PG_CATCH  (Robert Haas <robertmhaas@gmail.com>)
List 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

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: base backup client as auxiliary backend process
Next
From: Peter Eisentraut
Date:
Subject: Add const qualifiers to internal range type APIs