Re: "A transaction cannot be ended inside a block with exception handlers."
| От | David G. Johnston |
|---|---|
| Тема | Re: "A transaction cannot be ended inside a block with exception handlers." |
| Дата | |
| Msg-id | CAKFQuwbjWf2FTUruGzhx--f74ctw0MRLf_DwBXk0JO1LMnLx_A@mail.gmail.com обсуждение исходный текст |
| Ответ на | "A transaction cannot be ended inside a block with exception handlers." (Bryn Llewellyn <bryn@yugabyte.com>) |
| Ответы |
Re: "A transaction cannot be ended inside a block with exception handlers."
|
| Список | pgsql-general |
On Fri, May 6, 2022 at 4:40 PM Bryn Llewellyn <bryn@yugabyte.com> wrote:
Is there simply no way that inserts into table "t" in my example can be encapsulated in PL/pgSQL so that the error from the failing trigger can be handled rather there than escaping, raw, to the client?
Any potential solution to this problem will involve writing a stored procedure (CREATE PROCEDURE) which becomes the API layer for the application and each one probably issues a commit just prior to returning control to the calling application. Its exception handler can transform the at-commit errors to application errors and then return control to the calling application - which then needs to handle a clean return or an application-level error return.
David J.
В списке pgsql-general по дате отправления: