Re: Rules/Trigges Trade-offs - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: Rules/Trigges Trade-offs
Date
Msg-id 200212061741.gB6Hf7121431@candle.pha.pa.us
Whole thread Raw
In response to Re: Rules/Trigges Trade-offs  (Jean-Luc Lachance <jllachan@nsd.ca>)
List pgsql-sql
No, the rule will affect all the rows using one query.

---------------------------------------------------------------------------

Jean-Luc Lachance wrote:
> Thanks for the info.
> 
> Do you mean that if an update affects more than one row I should use
> triggers because the rules will be executed only once?
> 
> JLL
> 
> 
> Richard Huxton wrote:
> > 
> > On Friday 06 Dec 2002 4:03 pm, Jean-Luc Lachance wrote:
> > > Hi all!
> > >
> > > Is there a guideline on the use of rules compared to triggers when both
> > > can be use to achieve the same result?
> > 
> > If I can use rules I do. Rules rewrite the query so are processed once,
> > whereas triggers get processed for every row.
> > --
> >   Richard Huxton
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-sql by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: Rules/Trigges Trade-offs
Next
From: FatTony
Date:
Subject: order by a "select as" determined by case statement