Re: passing argument ro a trigger

From: Ivan il Terribile <darthxiong(at)libero(dot)it>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: passing argument ro a trigger
Date: 2002-02-23 12:51:10
Message-ID: 02022313511003.00473@master
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-admin by date

  From Date Subject
Next Message Lee Harr 2002-02-23 17:07:34 Re: Reset sequence number
Previous Message Gaetano Mendola 2002-02-23 12:33:24 Re: plpgsql error