Re: Disable Transaction - plans ? - Mailing list pgsql-general

From Tom Lane
Subject Re: Disable Transaction - plans ?
Date
Msg-id 1190.1003973376@sss.pgh.pa.us
Whole thread Raw
In response to Re: Disable Transaction - plans ?  ("Dominic J. Eidson" <sauron@the-infinite.org>)
List pgsql-general
Mike Mascari <mascarm@mascari.com> writes:
> So would it be
> possible to modify PQFinish() to examine whether autocommit = true,
> and if so, issue a commit before disconnect, else just disconnect?

That's just a slightly different way of shooting yourself in the foot.
What's the difference whether it's libpq or the backend that pulls
the trigger?  It's still not an explicit decision by the client.

I guess I do not understand the motivation for this proposal.
As I see it, the idea is that the client does not want an autocommit,
so he sets an option saying "no autocommit, hold transaction open until
I explicitly commit".  Why exactly would such a client think that an
autocommit on disconnect is a good idea?  The whole POINT is to require
an explicit commit command.  (ie, the client wants the gun in his own
hand, no delegation of the trigger decision, thank you very much)

ISTM people who like autocommit will be using our existing behavior.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Function won't compile
Next
From: Tom Lane
Date:
Subject: Re: Disable Transaction - plans ?