Re: PG_RE_THROW is mandatory (was Re: jsonpath)

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: PG_RE_THROW is mandatory (was Re: jsonpath)
Дата
Msg-id
28675.1549470418@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
PG_RE_THROW is mandatory (was Re: jsonpath) Alvaro Herrera <alvherre@2ndquadrant.com>
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>
Re: PG_RE_THROW is mandatory (was Re: jsonpath) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PG_RE_THROW is mandatory (was Re: jsonpath) Tom Lane <tgl@sss.pgh.pa.us>
Re: PG_RE_THROW is mandatory (was Re: jsonpath) Alvaro Herrera <alvherre@2ndquadrant.com>
Alvaro Herrera  writes:
> elog.h claims that PG_RE_THROW is "optional":

>  * (The braces are not actually necessary, but are recommended so that
>  * pgindent will indent the construct nicely.)  The error recovery code
>  * can optionally do PG_RE_THROW() to propagate the same error outwards.

> 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."

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.

			regards, tom lane

В списке pgsql-hackers по дате отправления
От: Andres Freund
Дата:
От: Andres Freund
Дата:
FAQ