I've a set of statements... pg_query('begin;'); pg_query('do stuff'); pg_query('do other stuff'); if(!pg_query('commit;')) { pg_query('rollback;'); // DO SOME CLEANUP HERE } if something goes wrong the statement actually get rolled back... but the pg_query('commit;') statement always succede so the cleanup never get executed. How am I going to see if the transaction succeeded without checking what happens for each statement and getting the cleanup code execute? thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it