Re: The new try/catch macros - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: The new try/catch macros
Date
Msg-id 4116820E.6090203@mailblocks.com
Whole thread Raw
In response to Re: The new try/catch macros  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: The new try/catch macros  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> A continue or break exiting the construct would do the wrong thing
> anyway, so I don't see that removing the do{} is very helpful.  The
> point of having it is to make sure that a try/end try block is
> syntactically like a statement, rather than like a { ... } construct.
>
Yes, a continue or break would fail. A PG_TRY_BREAK or PG_TRY_CONTINUE 
(as per my suggestion) would however work just fine.

And, you get a statement syntax anyway since you can do it all within 
one single if/else (i.e. with the PG_END_TRY as two ending braces only).

> This isn't really open for debate, because if we don't put that there,
> pg_indent will go nuts.
>
I'm not familiar with pg_indent but my guess is that the first and 
foremost motivation for its existence is code readability and consistent 
style? It must be simple to make it recognize and handle the new macros.  I volunteer to fix that if such a patch would
bewell received.
 

Regards,

Thomas Hallgren



pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: Ready for Beta ... ?
Next
From: Tom Lane
Date:
Subject: Re: The new try/catch macros