From: Martin Marques <martin@bugs.unl.edu.ar>
To: Robert Treat <xzilla@users.sourceforge.net>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: aspire420@hotpop.com, Sai Hertz And Control Systems <sank89@sancharnet.in>
Cc: pgsql-php@postgresql.org, Rui Hirokawa <rui_hirokawa@ybb.ne.jp>
Cc: Stig Bakken <ssb@fast.no>
Subject: Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4
Date: Fri, 12 Dec 2003 09:43:09 -0300
Message-ID: <200312120943.09487.martin@bugs.unl.edu.ar> (raw)
In-Reply-To: <200312112136.43688.martin@bugs.unl.edu.ar>
References: <3FD8E2C0.5060803@sancharnet.in>
<1071185106.1792.8265.camel@camel>
<200312112136.43688.martin@bugs.unl.edu.ar>
El Jue 11 Dic 2003 21:36, Martin Marques escribió:
> El Jue 11 Dic 2003 20:25, Robert Treat escribió:
> > (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 = 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 here.
By default PEAR::DB has autocommit set to true (it's defined at the begining
on the class), but with the changes in PG 7.4 the default should be false,
which would make it work right.
Now, the problem that I additionally find is that when autocommit is set to
true there isn't a BEGIN / END before and after the query. This should also
change, unless a new function is added to have autocommit changed in the DB
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 copy
--
09:21:01 up 16 days, 15:37, 2 users, load average: 0.61, 0.67, 0.45
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: martin@bugs.unl.edu.ar, xzilla@users.sourceforge.net, peter_e@gmx.net, sank89@sancharnet.in, rui_hirokawa@ybb.ne.jp, ssb@fast.no
Subject: Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4
In-Reply-To: <200312120943.09487.martin@bugs.unl.edu.ar>
References: <3FD8E2C0.5060803@sancharnet.in> <1071185106.1792.8265.camel@camel> <200312112136.43688.martin@bugs.unl.edu.ar> <200312120943.09487.martin@bugs.unl.edu.ar>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox