Re: AW: AW: [HACKERS] Rule system
От | Vadim Mikheev |
---|---|
Тема | Re: AW: AW: [HACKERS] Rule system |
Дата | |
Msg-id | 35D39A61.AFD397EA@krs.ru обсуждение исходный текст |
Ответ на | Re: AW: AW: [HACKERS] Rule system (jwieck@debis.com (Jan Wieck)) |
Ответы |
Re: AW: AW: [HACKERS] Rule system
|
Список | pgsql-hackers |
Jan Wieck wrote: > > It might look like: > > create trigger mytrig before insert or update on mytab > for each row do ( ^^ Why not EXECUTE ? > begin > new.lastupdate := 'now'; > return new; > end; > ) language 'plpgsql'; > > This would be easy. Just an enhancement to the parser and to > the create trigger utility processing so it creates the > required function on the fly. Modification of new, raising > errors via elog() and suppressing the operation itself by > returning NULL is already there in PL/pgSQL. We would need > something smart for the functions name, because using the ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > trigger name only would break the current possibility to ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > define the same trigger name on different tables with ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > different actions. Something like __trig_<oid> would be good. ^^^^^^^^^^^^^^^^^ I missed here. What did you mean? Vadim P.S. Sorry, I'm very busy currently :((
В списке pgsql-hackers по дате отправления: