Re: Two-phase commmit, plpgsql and plproxy

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Igor Katson <descentspb(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, plproxy-users(at)pgfoundry(dot)org
Subject: Re: Two-phase commmit, plpgsql and plproxy
Date: 2009-02-11 21:44:47
Message-ID: 1234388687.20157.7.camel@dell.linuxdev.us.dell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2009-02-11 at 12:43 +0300, Igor Katson wrote:
> ERROR: XX000: SPI_execute_plan failed executing query "PREPARE
> TRANSACTION '2pctest'": SPI_ERROR_TRANSACTION

It's probably treating the word PREPARE specially. You can avoid this
problem by using EXECUTE and specifying the command as a string.

> Is there a way to achieve the needed behaviour with two-phase commmit,
> plpgsql and plproxy ?

You can't begin or end a transaction inside a function. If that was
allowed, what would the function do after the transaction was prepared?

I think you need to do PREPARE TRANSACTION separately, somehow. You
might need to modify plproxy to do that the way you want.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Katson 2009-02-11 21:57:39 Re: Two-phase commmit, plpgsql and plproxy
Previous Message Scott Marlowe 2009-02-11 20:36:45 Re: Killing OIDs