From a2f690f92acaced14ee8f1ce8889ef27e6705237 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Sep 2020 04:50:33 -0400 Subject: [PATCH] adjust code to use PG_FINALLY --- src/pl/plpgsql/src/pl_exec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index d4a3d58..1fe4974 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -2313,7 +2313,7 @@ exec_stmt_call(PLpgSQL_execstate *estate, PLpgSQL_stmt_call *stmt) rc = SPI_execute_plan_with_paramlist(expr->plan, paramLI, estate->readonly_func, 0); } - PG_CATCH(); + PG_FINALLY(); { /* * If we aren't saving the plan, unset the pointer. Note that it @@ -2321,13 +2321,9 @@ exec_stmt_call(PLpgSQL_execstate *estate, PLpgSQL_stmt_call *stmt) */ if (expr->plan && !expr->plan->saved) expr->plan = NULL; - PG_RE_THROW(); } PG_END_TRY(); - if (expr->plan && !expr->plan->saved) - expr->plan = NULL; - if (rc < 0) elog(ERROR, "SPI_execute_plan_with_paramlist failed executing query \"%s\": %s", expr->query, SPI_result_code_string(rc)); -- 1.8.3.1