X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 79CD0DAFBD for ; Wed, 26 Oct 2005 22:17:09 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76825-08 for ; Thu, 27 Oct 2005 01:17:05 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id B3819DA9EC for ; Wed, 26 Oct 2005 22:17:07 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j9R1FsxG004967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 26 Oct 2005 19:15:56 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id j9R1Fs3m060134; Wed, 26 Oct 2005 19:15:54 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id j9R1FrKG060133; Wed, 26 Oct 2005 19:15:53 -0600 (MDT) (envelope-from mfuhr) Date: Wed, 26 Oct 2005 19:15:53 -0600 From: Michael Fuhr To: Terry Lee Tucker Cc: Postgre General Subject: Re: Error Message Message-ID: <20051027011553.GA60091@winnie.fuhr.org> References: <03a301c5da6e$a20b6280$ac1d4318@OWNER> <11706.1130361821@sss.pgh.pa.us> <041401c5da84$7429ec90$ac1d4318@OWNER> <200510261945.19824.terry@esc1.com> <20051027010006.GA59813@winnie.fuhr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051027010006.GA59813@winnie.fuhr.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/1682 X-Sequence-Number: 85910 On Wed, Oct 26, 2005 at 07:00:06PM -0600, Michael Fuhr wrote: > You *can* pass arguments to trigger functions but it's done a little > differently than with non-trigger functions. The function must be > defined to take no arguments; it reads the arguments from a context > structure instead of in the normal way. PL/pgSQL trigger functions, > for example, read their arguments from the TG_ARGV array. > > http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html > http://www.postgresql.org/docs/8.0/interactive/trigger-interface.html Also http://www.postgresql.org/docs/8.0/interactive/sql-createtrigger.html where the documentation says CREATE TRIGGER name { BEFORE | AFTER } { event [ OR ... ] } ON table [ FOR [ EACH ] { ROW | STATEMENT } ] EXECUTE PROCEDURE funcname ( arguments ) ... arguments An optional comma-separated list of arguments to be provided to the function when the trigger is executed. The arguments are literal string constants. Simple names and numeric constants may be written here, too, but they will all be converted to strings. Please check the description of the implementation language of the trigger function about how the trigger arguments are accessible within the function; it may be different from normal function arguments. -- Michael Fuhr