X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5D5B8475458 for ; Thu, 3 Apr 2003 05:12:57 -0500 (EST) Received: from hub.org (hub.org [64.117.224.146]) by postgresql.org (Postfix) with ESMTP id 7511D474E44 for ; Thu, 3 Apr 2003 05:12:56 -0500 (EST) Received: from hub.org (hub.org [64.117.224.146]) by hub.org (Postfix) with ESMTP id 5EDB81038DF1; Thu, 3 Apr 2003 06:12:55 -0400 (AST) Date: Thu, 3 Apr 2003 06:12:55 -0400 (AST) From: "Marc G. Fournier" To: Tom Lane Cc: pgsql-sql@postgresql.org Subject: Re: simple trigger question ... In-Reply-To: <25618.1049344429@sss.pgh.pa.us> Message-ID: <20030403061142.V72033@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> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, 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/32 X-Sequence-Number: 12733 On Wed, 2 Apr 2003, Tom Lane wrote: > "Marc G. Fournier" writes: > > Okay, so I do have to create the FUNCTION first, I can't do it without? > > Check. > > > Can a TRIGGER pass an arg to the FUNCTION? > > Yes, but only simple constant strings. (In this context, it might > make sense for the CREATE TRIGGER command to tell the function the > name of the specific sequence to increment.) '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?