From: | Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> |
---|---|
To: | houzj(dot)fnst(at)cn(dot)fujitsu(dot)com |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: Use PG_FINALLY to simplify code |
Date: | 2020-09-30 02:48:25 |
Message-ID: | 20200930.114825.991298637351393436.horikyota.ntt@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
At Tue, 29 Sep 2020 01:03:13 +0000, "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com> wrote in
> 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.
The patch removes PG_RETHROW(), which is crucial in the code
path. There's at least one other instance of that coding in pquery.c
but PG_FINALLY() is not applicable there for the same reason, too.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2020-09-30 02:52:47 | Document JSON primitive quoting and letter-case rules |
Previous Message | osumi.takamichi@fujitsu.com | 2020-09-30 02:33:21 | RE: Disable WAL logging to speed up data loading |