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

Re: transactions from PHP - double COMMIT required?

From: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: mikie <mikie(dot)pl(at)gmail(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: transactions from PHP - double COMMIT required?
Date: 2007-03-05 11:56:11
Message-ID: 45EC055B.80007@bugs.unl.edu.ar (view raw or flat)
Thread:
Lists: pgsql-php
mikie wrote:
> 2007/3/2, Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>:
>> mikie wrote:
>> > 2007/3/1, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>:
>> >> Yeah, do the above recommendation to see if all of your statements are
>> >> making
>> >> thier way into pg
>> >
>> > OK, I have checked the logs. I can see both COMMIT statements in the
>> > log - the first commit from my transaction and then the other that I
>> > send to workaround the problem.
>>
>> There must be some other problem. Do you have trasaction ID on the logs?
>> See if both commits go in the same transaction.
> 
> Could you please advise me how to check the transaction ID in the log?

Edit postgresql.conf:

log_line_prefix = '<%t %x>'

And restart postmaster.

>> Any errors during the transaction?
> 
> As I wrote in my first post, I make this error intentionally to check
> if  transaction works (if something fails, then the entire transaction
> should be rolled back). I intentionally give wrong data in the "date"
> field for example.
> Perhaps I should ask again: is it my responsibility to check if the
> transaction failed and issue a ROLLBACK command, or will the PG server
> do it automatically?

One question: Why dont you but each query in a diferent pg_exec() command?

-- 
  21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
---------------------------------------------------------
Lic. Martín Marqués         |   SELECT 'mmarques' ||
Centro de Telemática        |       '@' || 'unl.edu.ar';
Universidad Nacional        |   DBA, Programador,
     del Litoral             |   Administrador
---------------------------------------------------------

In response to

Responses

pgsql-php by date

Next:From: Charley TiggsDate: 2007-03-05 12:57:21
Subject: Re: transactions from PHP - double COMMIT required?
Previous:From: mikieDate: 2007-03-05 09:30:03
Subject: Re: transactions from PHP - double COMMIT required?

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