pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jim@nasby.net>
To: Benjamin Krajmalnik <kraj@illumen.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Rules/Triggers executio order
Date: Wed, 18 Oct 2006 23:27:38 -0500
Message-ID: <20061019042738.GD71084@nasby.net> (raw)
In-Reply-To: <F4E6A2751A2823418A21D4A160B68988315B@fletch.stackdump.local>
References: <F4E6A2751A2823418A21D4A160B68988315B@fletch.stackdump.local>

On Wed, Oct 18, 2006 at 06:42:21PM -0600, Benjamin Krajmalnik wrote:
> I have a partitioned table to which I route data using a trigger.
> I am changing it to use a set of rules which executes "INSTEAD" on
> insert.
> The parent table currently has a trigger.
>  
> The system is a live system.  I would prefer to not have to suspend the
> data flow.
> If I create the rules, and given the fact that they execute "INSTEAD" of
> the insertion into the parent table, will the trigger still execute.
> I will be removing the trigger immediately after the creation of the
> rules, but just want to be safe and make sure I get no duplicate
> entries.

An INSTEAD OF rule replaces the query that you originally had with the
one re-written by the rule, so no, the triggers shouldn't fire. But you
should test to make sure.
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



view thread (2+ messages)

Message-ID: <20061019042738.GD71084@nasby.net>
Permalink:  ../20061019042738.GD71084@nasby.net/
Also on:    postgresql.org/message-id/20061019042738.GD71084@nasby.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jim@nasby.net, kraj@illumen.com
  Subject: Re: Rules/Triggers executio order
  In-Reply-To: <20061019042738.GD71084@nasby.net>
  References: <F4E6A2751A2823418A21D4A160B68988315B@fletch.stackdump.local> <20061019042738.GD71084@nasby.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox