Rules, triggers and such

Started by George Silvaover 16 years ago2 messagesgeneral
Jump to latest
#1George Silva
georger.silva@gmail.com

Hello all again :)

I have a question: is it possible to replicate the behavior of a rule
INSTEAD of with a TRIGGER?

For some specific reasons i need to use a trigger to update a
secondary table, but i don't want the changes to happen in the primary
table too.

Is it possible to do it? If so, how?

I thought of using a instead of rule with a procedure, but a trigger
is just so much easier :P

Thanks

--
George R. C. Silva

Desenvolvimento em GIS
www.sextantegeo2.blogspot.com

#2Guillaume Lelarge
guillaume@lelarge.info
In reply to: George Silva (#1)
Re: Rules, triggers and such

Le mercredi 9 décembre 2009 à 17:04:32, George Silva a écrit :

Hello all again :)

I have a question: is it possible to replicate the behavior of a rule
INSTEAD of with a TRIGGER?

For some specific reasons i need to use a trigger to update a
secondary table, but i don't want the changes to happen in the primary
table too.

Is it possible to do it? If so, how?

Try a BEFORE trigger, and RETURN NULL in your stored function.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com