On Tue, 02 Mar 2004 21:35:27 -0600, Karl O. Pinc wrote:
<..>>
> CREATE TRIGGER pregs_insert_trigger
> AFTER INSERT
> ON pregs FOR EACH ROW
> EXECUTE PROCEDURE pregs_func('insert');
>
> CREATE TRIGGER pregs_update_trigger
> AFTER UPDATE
> ON pregs FOR EACH ROW
> EXECUTE PROCEDURE pregs_func('update');
>
According to the docs, this is unnecessary. A trigger function
automatically has a number of variables instantiated for it:
http://www.postgresql.org/docs/7.3/static/plpgsql-trigger.html#plpgsqltrigger
The TG_OP variable contains 'INSERT','UPDATE' or 'DELETE'.
--
Colin Fox
President
CF Consulting Inc.