Search Postgresql Archives

Two-phase commmit, plpgsql and plproxy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ?

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux