X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 12C48476323 for ; Thu, 3 Apr 2003 18:00:29 -0500 (EST) Received: from hub.org (hub.org [64.117.224.146]) by postgresql.org (Postfix) with ESMTP id 7FF0147631F for ; Thu, 3 Apr 2003 18:00:28 -0500 (EST) Received: from hub.org (hub.org [64.117.224.146]) by hub.org (Postfix) with ESMTP id DA7881038ECF; Thu, 3 Apr 2003 19:00:26 -0400 (AST) Date: Thu, 3 Apr 2003 19:00:26 -0400 (AST) From: "Marc G. Fournier" To: Rod Taylor Cc: pgsql-sql@postgresql.org Subject: Re: simple trigger question ... In-Reply-To: <1049380007.22629.14.camel@jester> Message-ID: <20030403185938.D7340@hub.org> References: <20030402223933.M71125@hub.org> <25296.1049341477@sss.pgh.pa.us> <20030403000605.U71125@hub.org> <25512.1049343373@sss.pgh.pa.us> <20030403002922.Y71125@hub.org> <25618.1049344429@sss.pgh.pa.us> <20030403061142.V72033@hub.org> <1049380007.22629.14.camel@jester> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-33.1 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/55 X-Sequence-Number: 12756 On Thu, 3 Apr 2003, Rod Taylor wrote: > > 'K, that makes it workable ... final question (I hope!) ... RULEs vs > > TRIGGERs? I ended up doing it as a RULE, since I could do it without a > > function ... but is there a reason why that is a Bad Idea? Or in a case > > like this, it doesn't really matter? > > Rules are per statement, not per row. > > An INSERT INTO ... SELECT ... statement will cause a single execution of > the rule even if you insert several hundred rows. Ah, okay, definitely not a good thing to use then ... thanks, will finish what I started with TRIGGERs instead :)