X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A8560D1B470 for ; Sat, 24 Apr 2004 02:50:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 44861-01 for ; Sat, 24 Apr 2004 02:50:26 -0300 (ADT) Received: from web13907.mail.yahoo.com (web13907.mail.yahoo.com [216.136.175.70]) by svr1.postgresql.org (Postfix) with SMTP id A14CBD1B9AA for ; Sat, 24 Apr 2004 02:50:23 -0300 (ADT) Message-ID: <20040424055022.96721.qmail@web13907.mail.yahoo.com> Received: from [213.23.207.109] by web13907.mail.yahoo.com via HTTP; Fri, 23 Apr 2004 22:50:22 PDT Date: Fri, 23 Apr 2004 22:50:22 -0700 (PDT) From: "Riccardo G. Facchini" Subject: Re: Trigger calling a function HELP ME! (2) To: pgsql-sql@postgresql.org In-Reply-To: <200404221219.12694.dev@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200404/264 X-Sequence-Number: 17639 --- Richard Huxton wrote: > On Wednesday 21 April 2004 16:16, abief_ag_-postgresql(at)yahoo.com > wrote: > > > CREATE OR REPLACE FUNCTION public.imp_test_to_out_test(imp_test) > > RETURNS imp_test AS > > 'begin > > return $1; > > end;' > > LANGUAGE 'plpgsql' STABLE; > > > > CREATE OR REPLACE FUNCTION public.imp_test_trigger() > > RETURNS trigger AS > > 'begin > > return imp_test_to_out_test(new); > > end;' > > LANGUAGE 'plpgsql' STABLE; > > This is your problem. NEW is a special variable, and I don't think > you can > pass it into another function (other than as NEW.col1, NEW.col2, > NEW.col3 > etc). > > You can however use TG_NAME or TG_RELNAME to see what trigger/table > called > you. I find that's helpful. > -- > Richard Huxton > Archonet Ltd > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org So, If I have to do a record-wide manipulation (almost all the fields) to the NEW record just before returning from the trigger, what other possibility do you suggest? thanks for your kind answer... ===== Riccardo G. Facchini