Two-phase commmit, plpgsql and plproxy

From: Igor Katson <descentspb(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, plproxy-users(at)pgfoundry(dot)org
Subject: Two-phase commmit, plpgsql and plproxy
Date: 2009-02-11 09:43:05
Message-ID: 49929DA9.7070709@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Max Strömberg 2009-02-11 09:46:36 Re: In need of help with message fetching query
Previous Message Raymond O'Donnell 2009-02-11 09:42:55 Re: Key Vs Index