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