pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin Marques <martin@bugs.unl.edu.ar>
To: mikie <mikie.pl@gmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: transactions from PHP - double COMMIT required?
Date: Mon, 05 Mar 2007 08:56:11 -0300
Message-ID: <45EC055B.80007@bugs.unl.edu.ar> (raw)
In-Reply-To: <ca35ce500703050130g46db55f1r23e2ef96fd8b18e7@mail.gmail.com>
References: <ca35ce500703010306nd06dcfcy1247fb2b4297b0c2@mail.gmail.com>
	<ca35ce500703010842v193a90cavdf8052330482ee9a@mail.gmail.com>
	<45E70C9A.200@bugs.unl.edu.ar>
	<200703011353.07621.xzilla@users.sourceforge.net>
	<ca35ce500703011138g2a7e0440w86fb85fd8f639604@mail.gmail.com>
	<45E81DC5.6090308@bugs.unl.edu.ar>
	<ca35ce500703050130g46db55f1r23e2ef96fd8b18e7@mail.gmail.com>

mikie wrote:
> 2007/3/2, Martin Marques <martin@bugs.unl.edu.ar>:
>> mikie wrote:
>> > 2007/3/1, Robert Treat <xzilla@users.sourceforge.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
---------------------------------------------------------



view thread (23+ messages)  latest in thread

Message-ID: <45EC055B.80007@bugs.unl.edu.ar>
Permalink:  ../45EC055B.80007@bugs.unl.edu.ar/
Also on:    postgresql.org/message-id/45EC055B.80007@bugs.unl.edu.ar

 · 

reply

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, mikie.pl@gmail.com
  Subject: Re: transactions from PHP - double COMMIT required?
  In-Reply-To: <45EC055B.80007@bugs.unl.edu.ar>
  References: <ca35ce500703010306nd06dcfcy1247fb2b4297b0c2@mail.gmail.com> <ca35ce500703010842v193a90cavdf8052330482ee9a@mail.gmail.com> <45E70C9A.200@bugs.unl.edu.ar> <200703011353.07621.xzilla@users.sourceforge.net> <ca35ce500703011138g2a7e0440w86fb85fd8f639604@mail.gmail.com> <45E81DC5.6090308@bugs.unl.edu.ar> <ca35ce500703050130g46db55f1r23e2ef96fd8b18e7@mail.gmail.com> <45EC055B.80007@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