3 ms·
I think I am missing something. Statement level for what?
by rpedela 11y ago
I think I am missing something. Statement level for what?
- tbrownaw 11y agocreate trigger tgr_whatever INSTEAD OF {update,insert,delete} on some_complex_view [for each row] <code goes here> Sometimes, if you run a DML statement on a view, the database can figure out how to translate that into DML on the underlying tables. Sometimes it can't. In this case the view is not updateable, unless you define appropriate "instead of" triggers on it. Some databases allow you do define these as statement-level triggers, that is without the "for each row" part. In that case the trigger will be passed all of the affected rows at once.
- anarazel 11y agoSo far postgres' statement level triggers do not have access to changed rows so far, be it an INSTEAD OF or any other kind of trigger. There has been some noise towards supporting it for AFTER triggers - I doubt we'll see BEFORE support, it's unclear to me what that'd even mean.
- rpedela 11y agoI see now. When I read it initially, I read it as "statement level ______ instead of triggers" rather than "statement level INSTEAD OF triggers". I thought a word was missing. Thanks!