Re: [HACKERS] Patching dblink.c to avoid warning about open transaction - Mailing list pgsql-patches

From David Fetter
Subject Re: [HACKERS] Patching dblink.c to avoid warning about open transaction
Date
Msg-id 20051007032204.GH30487@fetter.org
Whole thread Raw
In response to Re: [HACKERS] Patching dblink.c to avoid warning about open transaction  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [HACKERS] Patching dblink.c to avoid warning about open transaction
List 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@fetter.org http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Patching dblink.c to avoid warning about open transaction
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Patching dblink.c to avoid warning about open transaction