Skip site navigation (1) Skip section navigation (2)

Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4

From: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>,Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: aspire420(at)hotpop(dot)com,Sai Hertz And Control Systems <sank89(at)sancharnet(dot)in>,pgsql-php(at)postgresql(dot)org, Rui Hirokawa <rui_hirokawa(at)ybb(dot)ne(dot)jp>,Stig Bakken <ssb(at)fast(dot)no>
Subject: Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4
Date: 2003-12-12 12:43:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-adminpgsql-php
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(at)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' || '@' || ''
Centro de Telematica  |  DBA, Programador, Administrador
             Universidad Nacional
                  del Litoral

In response to

pgsql-admin by date

Next:From: Greg SpiegelbergDate: 2003-12-12 15:05:08
Subject: Reindex database
Previous:From: Rhaoni Chiu PereiraDate: 2003-12-12 12:39:59
Subject: ODBC Driver generates a too big "windows swap file" and it's too slow

pgsql-php by date

Next:From: Gerard SamuelDate: 2003-12-12 14:19:36
Subject: Re: [PHP-DB] pg_result_error()
Previous:From: Martin MarquesDate: 2003-12-12 00:36:43
Subject: Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group