Re: [HACKERS] ERROR action extension for rules?
CREATE RULE PasTouche AS ON UPDATE TO foo WHERE old.locked=TRUE DO INSTEAD ERROR; This would be sensible if rules were actually reasonable substitutes for triggers, but they are not. If you check the archives you will find many many cases where people tried to do this sort of thing, and got burned by the fundamental semantic differences ... Ok, I'll look into that. Thanks for the pointer. -- Fabien Coelho - [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] ERROR action extension for rules?
CREATE RULE PasTouche AS ON UPDATE TO foo WHERE old.locked=TRUE DO INSTEAD ERROR; I think this simple new rule action could be added to pg. I'm planning to do it, if there is no opposition. Any comments on this proposed new rule action? Or did I missed something obvious with rules? I've often debated creating an sql elog function for the ELSE segment of a CASE statement. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [HACKERS] ERROR action extension for rules?
Fabien COELHO [EMAIL PROTECTED] writes: I'm trying to use some RULE as simple and maybe slower TRIGGER, so as to make it impossible for a row to be modified once a boolean is set to lock it. ... However I thing that this would look much better to write simply: CREATE RULE PasTouche AS ON UPDATE TO foo WHERE old.locked=TRUE DO INSTEAD ERROR; This would be sensible if rules were actually reasonable substitutes for triggers, but they are not. If you check the archives you will find many many cases where people tried to do this sort of thing, and got burned by the fundamental semantic differences ... regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly