Re: The new try/catch macros

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Hallgren <thhal(at)mailblocks(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: The new try/catch macros
Date: 2004-08-09 01:38:00
Message-ID: 200408090138.i791c0t05494@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Thomas Hallgren <thhal(at)mailblocks(dot)com> writes:
> > 1. You use a do {...} while(0) construct to wrap the whole thing. This
> > actually makes it impossible to write code that does a try/catch within
> > a loop that contains code surrounding it since a continue or break will
> > then end up in the wrong place.
>
> 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.
>
> > 3. IMHO, it's a bit ugly to require parenthesis and semicolons at the
> > end of the macros.
>
> This isn't really open for debate, because if we don't put that there,
> pg_indent will go nuts.
>

Could we just teach pgindent about these macros?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-08-09 01:39:24 Re: listen_addresses GUC parameter
Previous Message Marc G. Fournier 2004-08-09 00:55:08 Re: 8.0.0beta1 ... packaged for testing ...