Re: Trigger and arguments question - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Trigger and arguments question
Date
Msg-id 20050527065453.Y80232@megazone.bigpanda.com
Whole thread Raw
In response to Trigger and arguments question  (Hervé Inisan <typo3@self-access.com>)
List pgsql-general
On Thu, 26 May 2005, [iso-8859-1] Herv� Inisan wrote:

> 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?
>
> Something like NEW.TG_ARGV[0]...
>
> I'm trying to write a kind of generic function which I could use on multiple
> tables with different field names (myarg being the field name).
> But I can't get it to work.
>
> Any clues or other solutions?

If you're using plpgsql, that's not possible.  It should be possible in
some of the other pl languges, however.

pgsql-general by date:

Previous
From: "David Parker"
Date:
Subject: Re: another failover testing question
Next
From: Jeff Trout
Date:
Subject: Re: Just a crazy idea!