Re: pgsql: Add optional parameter to PG_TRY() macros

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add optional parameter to PG_TRY() macros
Date: 2026-11-10 22:14:01
Message-ID: 3034120.1794348841@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> There's no public discussion about it, and I didn't think it critical
> enough to open a new thread about. I believe the newly added
> PG_PERL_TRY() macros would need a ##__VA_ARGS__ suffix on all the
> local variables, else we'd get shadow warnings if we ever nested
> PG_PERL_TRYs.

We would get some warnings for that anyway, because we don't have the
ability to change the name of the variable that Perl's dJMPENV macro
creates. So I didn't bother for the variables that are specific to
PG_PERL_TRY. The case I was mainly worried about was not gettimg
shadow warnings for PG_PERL_TRY nested within PG_TRY, which is a
pattern that exists now; so it's worth having the ##__VA_ARGS__
business on the variables that would conflict with PG_TRY.

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2026-11-10 22:50:20 pgsql: Avoid integer wraparound when adding new HASH partition
Previous Message David Rowley 2026-11-10 21:45:42 Re: pgsql: Add optional parameter to PG_TRY() macros