Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4

Поиск
Список
Период
Сортировка
От Martin Marques
Тема Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4
Дата
Msg-id 200312120943.09487.martin@bugs.unl.edu.ar
обсуждение исходный текст
Ответ на Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4  (Martin Marques <martin@bugs.unl.edu.ar>)
Список pgsql-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@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
-----------------------------------------------------------------


В списке pgsql-php по дате отправления:

Предыдущее
От: Martin Marques
Дата:
Сообщение: Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4
Следующее
От: Martin Marques
Дата:
Сообщение: Re: [PHP-DB] pg_result_error()