Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4E4879FA43B for ; Mon, 5 Mar 2007 11:17:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 79068-09 for ; Mon, 5 Mar 2007 11:16:52 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.248]) by postgresql.org (Postfix) with ESMTP id 3AF3B9FB232 for ; Mon, 5 Mar 2007 11:16:58 -0400 (AST) Received: by an-out-0708.google.com with SMTP id c24so1355478ana for ; Mon, 05 Mar 2007 07:16:56 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WorFLuc+hNCFWeE4wO10aYoyIUSiWRRKf7VCmaTaMFxuMGOzEn0AohDfN5vucM1mkCHUe4E6vKBT8gHB5nMZbM/eLx4ofJzVwE7P/Ht8VDQw47e7u7nzsPhlPV/fc1NwoPCNpAUWELA2hfvQ9FDovAY+ki1FBopoYRkO6naOOaQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oEdglrMFD9d2zRjoEl3UXfgX4SPZbi5i0v6GZa9bH7sNKmOoNi6RXsBIfa3SRlznEyNf7r2OsNHepybt0fIzpH56jZac9lOszl/Yt7UPAW1MZ8kcUgt9AsT/ljsRsoiagm96Ph4b8mEouhH0zsb5SZCs2tyZmH7kWIgCG3tv7FE= Received: by 10.100.144.11 with SMTP id r11mr2449512and.1173107816384; Mon, 05 Mar 2007 07:16:56 -0800 (PST) Received: by 10.100.165.1 with HTTP; Mon, 5 Mar 2007 07:16:56 -0800 (PST) Message-ID: Date: Mon, 5 Mar 2007 16:16:56 +0100 From: mikie To: pgsql-php@postgresql.org Subject: Re: transactions from PHP - double COMMIT required? In-Reply-To: <45EC055B.80007@bugs.unl.edu.ar> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45E70C9A.200@bugs.unl.edu.ar> <200703011353.07621.xzilla@users.sourceforge.net> <45E81DC5.6090308@bugs.unl.edu.ar> <45EC055B.80007@bugs.unl.edu.ar> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/24 X-Sequence-Number: 3736 2007/3/5, Martin Marques : > mikie wrote: > > 2007/3/2, Martin Marques : > >> mikie wrote: > >> > 2007/3/1, Robert Treat : > >> >> 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. Thanks, it works. I can see the transaction IDs -- I described my solution in my previous post. > >> 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? It does not make any difference if I put single query in each pg_query() command. --