Ross Bagley wrote: > I did come across FOUND, which leads to this: > > CREATE OR REPLACE FUNCTION delete_role(del_role_pk bigint) RETURNS int AS $$ > BEGIN > DELETE FROM br_actor_role_mm WHERE role_fk = del_role_pk; > DELETE FROM br_role_permission_mm WHERE role_fk = del_role_pk; > DELETE FROM br_role WHERE role_pk = del_role_pk; > IF FOUND THEN > RETURN 1; > ELSE > RETURN 0; > END IF; > END; > $$ LANGUAGE plpgsql; Right. Use GET DIAGNOSTICS foo = ROW_COUNT -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings