Two-phase commmit, plpgsql and plproxy

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

Предыдущее
От: Max Strömberg
Дата:
Сообщение: Re: In need of help with message fetching query
Следующее
От: Igor Katson
Дата:
Сообщение: Making a result of transaction visible to everyone, saving the ability for a rollback