X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 030DC3A428D for ; Tue, 30 Nov 2004 12:08:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83945-08 for ; Tue, 30 Nov 2004 12:08:41 +0000 (GMT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by svr1.postgresql.org (Postfix) with SMTP id 5D8513A5232 for ; Tue, 30 Nov 2004 12:08:41 +0000 (GMT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Tue Nov 30 13:08:35 2004 +0100 Received: from rodos.fzk.de (resy6.fzk.de [141.52.68.10]) by resy5.fzk.de (8.12.7/8.12.7/SuSE Linux 0.6) with ESMTP id iAUC8YsG004661; Tue, 30 Nov 2004 13:08:34 +0100 Message-ID: <41AC62C0.34D50EC7@rodos.fzk.de> Date: Tue, 30 Nov 2004 13:08:33 +0100 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: Richard Huxton Cc: pgsql-sql@postgresql.org Subject: Re: session-wide autocommit off References: <41AC31F5.CE3589FB@rodos.fzk.de> <41AC3CAA.2040201@archonet.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS - amavis-milter (http://www.amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/301 X-Sequence-Number: 19619 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