X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C6031D1B459 for ; Fri, 12 Dec 2003 12:44:08 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 16469-03 for ; Fri, 12 Dec 2003 08:43:40 -0400 (AST) Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by svr1.postgresql.org (Postfix) with ESMTP id 971D4D1B518 for ; Fri, 12 Dec 2003 08:43:36 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 3578912454; Fri, 12 Dec 2003 09:43:12 -0300 (ART) Received: from bugs.unl.edu.ar ([127.0.0.1]) by localhost (bugs [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14455-07; Fri, 12 Dec 2003 09:43:11 -0300 (ART) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 2148C12453; Fri, 12 Dec 2003 09:43:11 -0300 (ART) From: Martin Marques To: Robert Treat , Peter Eisentraut Subject: Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4 Date: Fri, 12 Dec 2003 09:43:09 -0300 User-Agent: KMail/1.5.4 Cc: aspire420@hotpop.com, Sai Hertz And Control Systems , pgsql-php@postgresql.org, Rui Hirokawa , Stig Bakken References: <3FD8E2C0.5060803@sancharnet.in> <1071185106.1792.8265.camel@camel> <200312112136.43688.martin@bugs.unl.edu.ar> In-Reply-To: <200312112136.43688.martin@bugs.unl.edu.ar> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200312120943.09487.martin@bugs.unl.edu.ar> X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at unl.edu.ar X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/20 X-Sequence-Number: 2466 El Jue 11 Dic 2003 21:36, Martin Marques escribi=F3: > El Jue 11 Dic 2003 20:25, Robert Treat escribi=F3: > > (personally i'm down with Scott, application developers should just use > > begin/commit, but i've met some folks who really look at it the other > > way) > > $db =3D DB::Connect("pgsql://user:pass@host/db"); > $db->autocommit(false); > $db->query(query1); > $db->query(query2); > $db->commit(); Replying to myself isn't a good thing, but I found something interesting he= re. By default PEAR::DB has autocommit set to true (it's defined at the beginin= g=20 on the class), but with the changes in PG 7.4 the default should be false,= =20 which would make it work right. Now, the problem that I additionally find is that when autocommit is set to= =20 true there isn't a BEGIN / END before and after the query. This should also= =20 change, unless a new function is added to have autocommit changed in the DB= =20 conection and PEAR::DB uses it to change the autocommit setting. P.D.: I'm adding the pgsql.php authors to the mail to see that they get a c= opy --=20 09:21:01 up 16 days, 15:37, 2 users, load average: 0.61, 0.67, 0.45 ----------------------------------------------------------------- Mart=EDn Marqu=E9s | select 'mmarques' || '@' || 'unl.edu.ar' Centro de Telematica | DBA, Programador, Administrador Universidad Nacional del Litoral -----------------------------------------------------------------