Re: check_recovery_target_lsn() does a PG_CATCH without a throw

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergei Kornilov <sk(at)zsrv(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: check_recovery_target_lsn() does a PG_CATCH without a throw
Date: 2019-06-11 14:49:28
Message-ID: 31260.1560264568@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sergei Kornilov <sk(at)zsrv(dot)org> writes:
>> That's not OK.

> hmm. Did you mean catching only needed errors by errcode? Something like attached?

No, he means you can't EVER catch an error and not re-throw it, unless
you do a full (sub)transaction abort and cleanup instead of re-throwing.
We've been around on this repeatedly because people want to believe they
can take shortcuts. (See e.g. discussions for the jsonpath stuff.)
It doesn't reliably work to do so, and we have a project policy against
trying, and this code should never have been committed in this state.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-06-11 15:35:54 Re: check_recovery_target_lsn() does a PG_CATCH without a throw
Previous Message Jose Luis Tallon 2019-06-11 14:47:28 Re: [PATCH] Implement uuid_version()