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

Re: taking actions on rollback (PHP)

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: taking actions on rollback (PHP)
Date: 2008-04-26 21:14:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Sat, Apr 26, 2008 at 10:52:12PM +0200, Ivan Sergio Borgonovo wrote:
> How am I going to see if the transaction succeeded without checking
> what happens for each statement and getting the cleanup code execute?

You basically actually check for the errors in the earlier pg_query()
calls, since they will tell you. If you can't be bothered, you could
just do at the end of the transaction:

if( !pg_query("select 1") )
{ pg_query("commit"); }

Have a nice day,
Martijn van Oosterhout   <kleptog(at)svana(dot)org>
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

In response to


pgsql-general by date

Next:From: wstrzalkaDate: 2008-04-26 22:11:20
Subject: PITR problem
Previous:From: Ivan Sergio BorgonovoDate: 2008-04-26 20:52:12
Subject: taking actions on rollback (PHP)

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