Re: passing argument ro a trigger - Mailing list pgsql-admin

From Ivan il Terribile
Subject Re: passing argument ro a trigger
Date
Msg-id 02022313511003.00473@master
Whole thread Raw
In response to passing argument ro a trigger  (darthxiong@libero.it)
List pgsql-admin
Il Friday 22 February 2002 23:43, pur dolorante per l' artrite alle
dita, scrivesti....
> > CREATE TRIGGER trigger_align_status
> > AFTER INSERT ON table2
> > FOR EACH STATEMENT
> > EXECUTE PROCEDURE align_status ( UUUAAAAAAAARRGGHHH );
>
> Trys this:
>
> Execute Procedure align_status ((select max(major) from
> table1));
> ** note 2 parentesis...

the major modified is not necessarily the last.... but this is an idea!
the number of the major modified can be found looking at insert time :>
Execute Procedure align_status ((
   select major from table1 where major_time = max( major_time )
));
maior_time stores the time of insertion of the touple
thanks for the hint... this solves my problem! but the general idea was:
there is a way for the trigger activated in AFTER mode to know ( and
refer to, and use ) its activator touple ?
the smartest way could be
 CREATE TRIGGER trigger_align_status
 AFTER INSERT ON table2
 FOR EACH STATEMENT
 EXECUTE PROCEDURE align_status ( pointer_to_activator_touple.field );

TIA

--
   (@_  Ivan Fabris, S.Sofia (FC) Powered by Linux Debian Woody   _*)
   //\      www.darthxiong.net   setiathome.ssl.berkeley.edu      /\\
   V_/_     www.folug.linux.it   pgp key @ www.keyserver.net     _\_V


pgsql-admin by date:

Previous
From: "Gaetano Mendola"
Date:
Subject: Re: plpgsql error
Next
From: Peter Eisentraut
Date:
Subject: Re: psql --single-step mode doesn't like empty sets