Hello,
I need a trigger which is updating a delete flag of a row instead of
deleting it physically.

How do I implement a trigger which doesn't execute a delete without raising
an exception
in plsql ?

CREATE TRIGGER trigger1 BEFORE DELETE ON table1
FOR EACH ROW EXECUTE PROCEDURE setDeleteFlag ();

If I use
RAISE EXCEPTION "..."
the delete statement isn't executed, but I think the transaction is rolled
back too, am I right ?

So what is the best way to implement something (Oracle like) like that :
CREATE TRIGGER trigger1 INSTEAD OF DELETE ON table1
FOR EACH ROW EXECUTE PROCEDURE setDeleteFlag ();

thx


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to