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)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> 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
Дата:
Сообщение: Re: PG_RE_THROW is mandatory (was Re: jsonpath)
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Don't deform column-by-column in composite_to_json