Re: psycopg and two phase commit

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psycopg and two phase commit
Date: 2010-09-19 17:38:09
Message-ID: AANLkTikgCbAsPV1=AKXUfddkW1c87hV_QnfcOihMRuug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 18, 2010 at 5:01 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> Hello
>
> who is psycopg maintainer, please?

Here is one. The others can be usually mailed on the psycopg mailing
list, which is currently down and being recovered.

> Can somebody explains to me, why
> psycopg doesn't support twophase commit still, although some
> implementation was done in summer 2008?

Probably because nobody has asked before and it has been nobody's itch
to scratch.

The work you probably refer to seems Jason Henstridge's. I didn't know
anything about it, but I've bcc'd him so he can provide details.

https://code.launchpad.net/~jamesh/psycopg/two-phase-commit

> Now two phase commit is part of DB-API, so can be implemented.
>
> There are some bariers?

I see none at a first glance. I just don't get the intricacies of the
.xid() method suggested in the dbapi
(http://www.python.org/dev/peps/pep-0249/) while a regular string
would do - and the xid has to be converted in a string anyway to be
passed to the Postgres TPC statements. So I'm tempted to allow the
tpc_*() methods to accept a simple string too as parameter; also
because otherwise psycopg wouldn't be able to manipulate a transaction
prepared by other tools (e.g. retrieving a xid using tpc_recover() and
passing it to tpc_commit()/tpc_rollback(), a limitation that can be
avoided.

I can work on the feature, first I'd like to review James's code and
possibly hear from him his impressions.

-- Daniele

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2010-09-19 17:47:38 Re: BUG #5662: Incomplete view
Previous Message Tom Lane 2010-09-19 16:52:38 Re: Report: removing the inconsistencies in our CVS->git conversion