Hey list,
so I was wondering. Since many ppl depend on 'affected rows', we have here a trigger running on delete. It will update the table, and set certain fields to false on delete, return NULL - so it will look like:
CREATE OR REPLACE FUNCTION ondelete_update() returns trigger as
$_$
BEGIN
IF OLD.foo <> false THEN
EXECUTE 'UPDATE ' || TG_RELNAME || ' SET foo = 'true' WHERE rid = ' || OLD.rid ;
END IF;
RETURN NULL;
END;
$_$
LANGUAGE 'plpgsql';
Now, this on every delete will return 'affected rows count = 0'. C
--
GJ