Re: Trigger calling a function HELP ME! (2) - Mailing list pgsql-sql

From Riccardo G. Facchini
Subject Re: Trigger calling a function HELP ME! (2)
Date
Msg-id 20040424055022.96721.qmail@web13907.mail.yahoo.com
Whole thread Raw
In response to Re: Trigger calling a function HELP ME! (2)  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
--- Richard Huxton <dev(at)archonet.com> 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


pgsql-sql by date:

Previous
From: "Jaime Casanova"
Date:
Subject: Re: lifetime of temp schema versus compiled image of plpgsql proc
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: Order by YYYY MM DD in reverse chrono order trouble