Re: Rules, triggers and such

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: pgsql-general(at)postgresql(dot)org
Cc: George Silva <georger(dot)silva(at)gmail(dot)com>
Subject: Re: Rules, triggers and such
Date: 2009-12-09 16:08:50
Message-ID: 200912091708.50785.guillaume@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Levchenko 2009-12-09 18:04:59 Problem with SET CONSTRAINTS some_constraint_fkey DEFERRED
Previous Message George Silva 2009-12-09 16:04:32 Rules, triggers and such