diff options
| author | David Rowley | 2022-10-05 21:08:31 +0000 |
|---|---|---|
| committer | David Rowley | 2022-10-05 21:08:31 +0000 |
| commit | 112f0225dbfe8af217294bfa0bd227f3302a1658 (patch) | |
| tree | 4087e349808244d0520c8be35e8dfc2777e51fe8 /src/backend/tcop | |
| parent | 23f3989d929e9301a29ee3a25ecf8040d8de20c2 (diff) | |
Add optional parameter to PG_TRY() macros
This optional parameter can be specified in cases where there are nested
PG_TRY() statements within a function in order to stop the compiler from
issuing warnings about shadowed local variables when compiling with
-Wshadow. The optional parameter is used as a suffix on the variable
names declared within the PG_TRY(), PG_CATCH(), PG_FINALLY() and
PG_END_TRY() macros. The parameter, if specified, must be the same in
each component macro of the given PG_TRY() block.
This also adjusts the single case where we have nested PG_TRY() statements
to add a parameter to the inner-most PG_TRY().
This reduces the number of compiler warnings when compiling with
-Wshadow=compatible-local from 5 down to 1.
Author: David Rowley
Discussion: https://postgr.es/m/CAApHDvqWGMdB_pATeUqE=JCtNqNxObPOJ00jFEa2_sZ20j_Wvg@mail.gmail.com
Diffstat (limited to 'src/backend/tcop')
| -rw-r--r-- | src/backend/tcop/utility.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index aa008157878..247d0816ad8 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -1678,16 +1678,16 @@ ProcessUtilitySlow(ParseState *pstate, * command itself is queued, which is enough. */ EventTriggerInhibitCommandCollection(); - PG_TRY(); + PG_TRY(2); { address = ExecRefreshMatView((RefreshMatViewStmt *) parsetree, queryString, params, qc); } - PG_FINALLY(); + PG_FINALLY(2); { EventTriggerUndoInhibitCommandCollection(); } - PG_END_TRY(); + PG_END_TRY(2); break; case T_CreateTrigStmt: |
