Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 683A5475A9E for ; Fri, 6 Dec 2002 12:29:41 -0500 (EST) Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id 7F708475E26 for ; Fri, 6 Dec 2002 12:29:40 -0500 (EST) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id MAA02840; Fri, 6 Dec 2002 12:29:42 -0500 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma002838; Fri, 6 Dec 02 12:29:31 -0500 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id MAA08929; Fri, 6 Dec 2002 12:28:09 -0500 Message-ID: <3DF0DEA7.14D89064@nsd.ca> Date: Fri, 06 Dec 2002 12:30:15 -0500 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-31 i686) X-Accept-Language: en MIME-Version: 1.0 To: Richard Huxton Cc: pgsql-sql Subject: Re: Rules/Trigges Trade-offs References: <7C760DAA511DC74B99E7D22189F786F1906DB0@MAIL01.stbernard.com> <3C90F994.3080605@joeconway.com> <3DF0CA63.84F4D48@nsd.ca> <200212061631.06077.dev@archonet.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/75 X-Sequence-Number: 10663 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