Received: from alquanto.nextra.it (alquanto.nextra.it [193.43.2.90]) by postgresql.org (Postfix) with ESMTP id 397DA476134 for ; Sat, 23 Feb 2002 07:44:51 -0500 (EST) Received: from master (it14a21-056.dialup.nettuno.it [130.186.67.56]) by alquanto.nextra.it (8.9.3/8.9.3/NETTuno 5.0) with SMTP id NAA09779 for ; Sat, 23 Feb 2002 13:44:50 +0100 (MET) Content-Type: text/plain; charset="iso-8859-1" From: Ivan il Terribile To: pgsql-admin@postgresql.org Subject: Re: passing argument ro a trigger Date: Sat, 23 Feb 2002 13:51:10 +0100 X-Mailer: KMail [version 1.2] References: In-Reply-To: MIME-Version: 1.0 Message-Id: <02022313511003.00473@master> Content-Transfer-Encoding: 8bit X-Archive-Number: 200202/317 X-Sequence-Number: 3470 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