Re: PG_RE_THROW is mandatory (was Re: jsonpath)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: PG_RE_THROW is mandatory (was Re: jsonpath)
Дата
Msg-id 20190207200427.GA17152@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: PG_RE_THROW is mandatory (was Re: jsonpath)  (Andres Freund <andres@anarazel.de>)
Ответы Re: PG_RE_THROW is mandatory (was Re: jsonpath)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> On 2019-02-06 13:09:59 -0300, Alvaro Herrera wrote:

> > This is obviously wrong; while we have a couple of codesites that omit
> > it, it's not a generally available coding pattern.  I think we should
> > amend that comment.  I propose: "The error recovery code must normally
> > do PG_RE_THROW() to propagate the error outwards; failure to do so may
> > leave the system in an inconsistent state for further processing."

On 2019-Feb-06, Andres Freund wrote:

> Well, but it's ok not to rethrow if you do a [sub]transaction
> rollback. I assume that's why it's framed as optional. We probably
> should reference that fact?

On 2019-Feb-06, Tom Lane wrote:

> Well, it can either do PG_RE_THROW or do a (sub)transaction abort.
> Some level of throw-catching code has to do the latter eventually.

So,

"The error recovery code can either do PG_RE_THROW to propagate the
error outwards, or do a (sub)transaction abort.  Failure to do so may
leave the system in an inconsistent state for further processing."

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: use Getopt::Long for catalog scripts
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PG_RE_THROW is mandatory (was Re: jsonpath)