Re: alternative to PG_CATCH

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Subject: Re: alternative to PG_CATCH
Date: 2019-11-01 10:27:48
Message-ID: 9fd28aef-cdea-eb4b-c966-c32eee09b69e@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-10-29 17:10, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
>> On 2019-10-28 13:45, Robert Haas wrote:
>>> In theory, the do_rethrow variable could conflict with a symbol
>>> declared in the surrounding scope, but that doesn't seem like it's a
>>> problem worth getting worked up about.
>
>> Right. A PG_TRY block also declares other local variables for internal
>> use without much care about namespacing. If it becomes a problem, it's
>> easy to address.
>
> Although we haven't been terribly consistent about it, some of our macros
> address this problem by using local variable names with a leading and/or
> trailing underscore, or otherwise making them names you'd be quite
> unlikely to use in normal code. I suggest doing something similar
> here. (Wouldn't be a bad idea to make PG_TRY's variables follow suit.)

committed with a leading underscore

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2019-11-01 10:28:29 Re: [HACKERS] advanced partition matching algorithm for partition-wise join
Previous Message Pavel Stehule 2019-11-01 09:25:17 Re: 64 bit transaction id