Monday, January 15, 2007

Transactions and deletes in pgsql

begin transaction;
delete from pixpair_ips where pixpair_id in (
select id from pixpair where pic1_id = 518 or pic2_id=518);
delete from pixpair where pic1_id = 518 or pic2_id=518;
DELETE 41
select update_pixpair(518);
update_pixpair
----------------
43
commit transaction;
COMMIT

No comments: