Joe Conway wrote:
> Tom Lane wrote:
> > David Fetter <[EMAIL PROTECTED]> writes:
> > 
> >>On Thu, Oct 06, 2005 at 10:38:54PM -0400, Bruce Momjian wrote:
> >>
> >>>I don't know if people want this for 8.1 or 8.2.
> > 
> >>8.1, IMHO.  It's a bug fix. :)
> > 
> > Not unless Joe Conway signs off on it ...
> > 
> I had asked on the original simple patch, and I'll ask again now -- why 
> is this needed? I don't have a clear understanding of the problem that 
> this (or the earlier) patch is trying to solve. Without that, it is 
> impossible to say whether it is a bug fix or feature.

Well, as I said in the patch email:

        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.

If a remote transactions has already been started by the user,
dblink_open is going to call BEGIN, which is going to fail because there
is already an open transaction, right?

Here is an crude example:
        test=> BEGIN;
        test=> begin;
        WARNING:  there is already a transaction in progress
        test=> SELECT 1;
        (1 row)
        test=> COMMIT;
        test=> COMMIT;
        WARNING:  there is no transaction in progress

The BEGIN and COMMIT are only a warning though, but the early COMMIT by
the dblink_close() is a serious issue.

  Bruce Momjian                        |               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to