Re: Trigger and arguments question

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
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 13:56:33
Message-ID: 20050527065453.Y80232@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Trout 2005-05-27 14:14:03 Re: Just a crazy idea!
Previous Message David Parker 2005-05-27 13:37:25 Re: another failover testing question