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