Re: Dynamic Log tigger (plpgsql)

From: Noah Heusser <pgsql-general(at)heussers(dot)ch>
To: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Dynamic Log tigger (plpgsql)
Date: 2007-06-21 22:50:11
Message-ID: 467B00A3.1010802@heussers.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sergey Konoplev schrieb:
>> My Question:
>> How can I do "OLD.columnName != NEW.columnName" if I don't know what the
>> columnNames are at Compile Time?
>> I have the columnName in a variable.
>>
>
> I suggest you use plpython. In this case you'll be able to do it.
>
> TD['old'][colNameVar] != TD['new'][colNameVar]
>
thx, you are right. These Languages are trusted like pgsql,

Did it in Perl:

foreach $key (keys %{$_TD->{old}}) {
if($_TD->{old}{$key} ne $_TD->{new}{$key}){

}
}

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-06-21 23:13:28 Re: Throwing exceptions
Previous Message Scott Marlowe 2007-06-21 22:40:59 Re: Excell