Search Postgresql Archives

pass NEW / OLD variable in trigger to table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm using some trigger functions on a view. Can I pass the NEW / OLD variable to the table of the view?
An excerpt of my view shows:

 IF TG_OP = 'INSERT' then
        insert into mytable (name, data, commentdata, history) values (NEW.name, NEW.data, NEW.commentdata, NEW.history);
ernd if;

Can I do anything like "insert into mytable values (NEW)" ? Can I do this with update and delete also?
I would like to pass the variable with the "action" to the table, so I need not to reference the fields

Thanks

Phil


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux