Re: session-wide autocommit off - Mailing list pgsql-sql

From Christoph Haller
Subject Re: session-wide autocommit off
Date
Msg-id 41AC62C0.34D50EC7@rodos.fzk.de
Whole thread Raw
In response to session-wide autocommit off  (Christoph Haller <ch@rodos.fzk.de>)
List pgsql-sql
Richard Huxton wrote:

> Christoph Haller wrote:
> > Looks like I asked the wrong question the other day.
> > How can I achieve a session-wide autocommit off?
> > As it is possible inside a psql session via
> > \unset AUTOCOMMIT
> > I am using the libpq interface.
>
> Just BEGIN a transaction after connection? Or am I missing something here?
>

Since the server-side autocommit off was abolished in 7.4
I am looking for a session-wide replacement, meaning
as long as one connection is running, after every COMMIT
the next SQL-command triggers an implicit BEGIN.
I know the usual answer to requests like this is "Fix Your Code",
but the Release Notes on 7.4 state
The server-side autocommit setting was removed and reimplemented in
client applications and languages. Server-side
autocommit was causing too many problems with languages and applications
that wanted to control their own autocommit
behavior, so autocommit was removed from the server and added to
individual client APIs as appropriate.

So basically, I cannot find the autocommit-off-switch within the libpg
interface.
TIA
Regards, Christoph




pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: session-wide autocommit off
Next
From: "Andrew Thorley"
Date:
Subject: inserting values into types