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)
|
| Список | 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 по дате отправления: