Two-phase commmit, plpgsql and plproxy
| От | Igor Katson |
|---|---|
| Тема | Two-phase commmit, plpgsql and plproxy |
| Дата | |
| Msg-id | 49929DA9.7070709@gmail.com обсуждение исходный текст |
| Ответы |
Re: Two-phase commmit, plpgsql and plproxy
Re: [Plproxy-users] Two-phase commmit, plpgsql and plproxy |
| Список | pgsql-general |
I would like to call several plproxy functions one after another (which will call plpgsql functions in different target partitions), and in case one of them fails, i want to roll back changes in every one. That is exactly how two-phase-commit (2PC) should work. As far as I understand, the postgres' group of statements like PREPARE TRANSACTION can do this job. But when trying to insert a 'PREPARE TRANSACTION' statement into a PL/Pgsql function I get an error: ERROR: XX000: SPI_execute_plan failed executing query "PREPARE TRANSACTION '2pctest'": SPI_ERROR_TRANSACTION Is there a way to achieve the needed behaviour with two-phase commmit, plpgsql and plproxy ?
В списке pgsql-general по дате отправления: