Skip site navigation (1) Skip section navigation (2)

Re: Trigger and arguments question

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Hervé Inisan <typo3(at)self-access(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger and arguments question
Date: 2005-05-27 09:20:53
Message-ID: 4296E675.2090701@magproductions.nl (view raw or flat)
Thread:
Lists: pgsql-general
Hervé Inisan wrote:
> Hi everybody!
> 
> I have a trigger like this:
> 
> CREATE TRIGGER mytrigger
>    AFTER INSERT OR UPDATE OR DELETE
>    ON myschema.mytable
>    FOR EACH ROW
>    EXECUTE PROCEDURE myschema.myfunction(myarg);
> 
> It sends an argument to myfunction(), and I can retrieve this value in
> TG_ARGV[0]. Fine.
> What I'm trying to do is using TG_ARGV[0] to point to a field in NEW or OLD.
> Is it possible?

You'll be missing OLD and NEW on INSERT and DELETE respectively, I'm 
afraid. You may want to split your triggers for different events.

-- 
Alban Hertroys
MAG Productions

T: +31(0)53 4346874
F: +31(0)53 4346876
E: alban(at)magproductions(dot)nl
W: http://www.magproductions.nl


In response to

Responses

pgsql-general by date

Next:From: Nageshwar RaoDate: 2005-05-27 09:58:46
Subject: relocation error-urgent
Previous:From: Douglas McNaughtDate: 2005-05-27 08:52:30
Subject: Re: Visual Studio 2005 .Net -> Npgsql -> Postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group