pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ivan il Terribile <darthxiong@libero.it>
To: pgsql-admin@postgresql.org
Subject: Re: passing argument ro a trigger
Date: Sat, 23 Feb 2002 13:51:10 +0100
Message-ID: <02022313511003.00473@master> (raw)
In-Reply-To: <GRYHSU$IDdF0mCV8IVkcwV4nVfdsGe1Htnog3r90wF9QHv3dZ1pa@bol.com.br>
References: <GRYHSU$IDdF0mCV8IVkcwV4nVfdsGe1Htnog3r90wF9QHv3dZ1pa@bol.com.br>

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




view thread (2+ messages)

Message-ID: <02022313511003.00473@master>
Permalink:  ../02022313511003.00473@master/
Also on:    postgresql.org/message-id/02022313511003.00473@master

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: darthxiong@libero.it
  Subject: Re: passing argument ro a trigger
  In-Reply-To: <02022313511003.00473@master>
  References: <GRYHSU$IDdF0mCV8IVkcwV4nVfdsGe1Htnog3r90wF9QHv3dZ1pa@bol.com.br> <02022313511003.00473@master>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox