Use PG_FINALLY to simplify code

From: "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Use PG_FINALLY to simplify code
Date: 2020-09-29 01:03:13
Message-ID: b3a00de043a144cc962f5de0479bc478@G08CNEXMBPEKD05.g08.fujitsu.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

In (/src/pl/plpgsql/src/pl_exec.c), I found some code like the following:

PG_CATCH();
{
if (expr->plan && !expr->plan->saved)
expr->plan = NULL;
PG_RE_THROW();
}
PG_END_TRY();

if (expr->plan && !expr->plan->saved)
expr->plan = NULL;

Since PG_FINALLY can be used now, I think we can use PG_FINALLY to simplify code here.

Best regards,
houzj

Attachment Content-Type Size
0001-adjust-code-to-use-PG_FINALLY.patch application/octet-stream 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2020-09-29 01:14:06 Re: Report error position in partition bound check
Previous Message Tom Lane 2020-09-29 00:37:52 Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros