Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000 |
| Дата | |
| Msg-id | 1830668.1742655550@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000 (Christophe Pettus <xof@thebuild.com>) |
| Ответы |
Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000
|
| Список | pgsql-general |
Christophe Pettus <xof@thebuild.com> writes:
> A procedure cannot issue top-level transaction control statements from within an exception block, and attempting to
doso raises the error you saw. This includes procedures that are called from within an exception block.
Yeah. Postgres doesn't have autonomous transactions (not yet anyway),
and you can't fake them like that.
A way that does work, I believe, is to set up a second session with
dblink[1] and use that to issue the autonomous transaction. Ugly
and inefficient for sure, but if you've gotta have it...
regards, tom lane
[1] https://www.postgresql.org/docs/current/dblink.html
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера