Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
От | Christophe Pettus |
---|---|
Тема | Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP |
Дата | |
Msg-id | 408C4DF8-2F05-401A-B4BC-FAAAFE79CA49@thebuild.com обсуждение исходный текст |
Ответ на | Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP (Bryn Llewellyn <bryn@yugabyte.com>) |
Список | pgsql-general |
> On Oct 18, 2022, at 14:15, Bryn Llewellyn <bryn@yugabyte.com> wrote: > Could the limitation be lifted by making tractable internal implementation changes? Or is it rooted in profoundly deepfeatures of the architecture—meaning that it could never be lifted? That is a very good question. One of the issues (as I understand it) is to be able to continue to use the same connectionin the event of an error. Here's the scenario: 1. SELECT * FROM my_func(); 2. my_func gets an error. The connection is now in an error state. 3. So, catching the exception doesn't do you much good, because future operations will get an error. This problem is solved by wrapping it in a savepoint, since rolling back to the savepoint will undo the error state of theconnection. There might be a way forward, but it's hard to get the proper semantics of an exception handler without doing something likethat.
В списке pgsql-general по дате отправления: