Re: [HACKERS] Patching dblink.c to avoid warning about open transaction

From: David Fetter <david(at)fetter(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Jonathan Beit-Aharon <jbeitaharon(at)intrusic(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: [HACKERS] Patching dblink.c to avoid warning about open transaction
Date: 2005-10-07 03:22:04
Message-ID: 20051007032204.GH30487@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, Oct 06, 2005 at 10:38:54PM -0400, Bruce Momjian wrote:
> > I'm not a member of this list (yet), so please CC me on responses
> > and discussion. The patch below seems to be completion of work
> > already started, because the boolean remoteTrFlag was already
> > defined, and all I had to add was its setting and two references.
> > I hope someone will find it useful,
> >
> > Jonathan
>
> I have worked on this issue and have an extensive patch to dblink to
> fix it.
>
> The reported problem is that dblink_open/dblink_close() (for cursor
> reads) do a BEGIN/COMMIT regardless of the transaction state of the
> remote connection. There was code in dblink.c to track the remote
> transaction state (rconn), but it was not being maintained or used.
>
> This patch fixes that by routing all connections through an rconn
> structure and using the transaction status properly. I removed the
> global persistent connection and function-local 'conn' structures in
> favor of using rconn consistently. This cleans up a lot of
> error-prone code that tried to track what type of connection was
> being used.
>
> I don't know if people want this for 8.1 or 8.2.

8.1, IMHO. It's a bug fix. :)

Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-10-07 03:31:46 Re: [HACKERS] Patching dblink.c to avoid warning about open transaction
Previous Message Qingqing Zhou 2005-10-07 03:19:45 Re: prefix btree implementation

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-10-07 03:31:46 Re: [HACKERS] Patching dblink.c to avoid warning about open transaction
Previous Message Bruce Momjian 2005-10-07 02:38:54 Re: [HACKERS] Patching dblink.c to avoid warning about open transaction