Re: INSTEAD OF trigger on VIEWs
| От | Russell Smith | 
|---|---|
| Тема | Re: INSTEAD OF trigger on VIEWs | 
| Дата | |
| Msg-id | 200505241906.53948.mr-russ@pws.com.au обсуждение исходный текст | 
| Ответ на | Re: INSTEAD OF trigger on VIEWs (--= Tono =-- <tonodarmodjo@yahoo.com>) | 
| Ответы | SELECTs inside of VIEWs (WAS: INSTEAD OF trigger on VIEWs) | 
| Список | pgsql-hackers | 
On Tue, 24 May 2005 01:26 am, --= Tono =-- wrote: > I have tried using INSTEAD rules but there are some > conditional logic that needs to happen inside the rule > (performing counts, getting and storing the primary > key of the master record etc.). AFAIK, rules only > allows conditional logic to be check prior to > execution of the rule and not inside the rule itself. > One way to get around this is to allow calling a > stored procedure inside the rule. This stored > procedure should have full access of NEW.* (and OLD.* > in the case of UPDATE and DELETE). This way the > manual INSERT, UPDATE or DELETE on the actual tables > can be performed from inside the stored procedure. > Would it be possible to add an INSTEAD OF rule that calls a function. You could then use that function as the trigger you wanted. I'm not even sure if this is possible. DO INSTEAD SELECT * FROM function(rowtype); Regards Russell Smith.
В списке pgsql-hackers по дате отправления: