Re: How to iterate fields into a NEW.* RECORD in a TRIGGER procedure ? - Mailing list pgsql-general

From Pavel Stehule
Subject Re: How to iterate fields into a NEW.* RECORD in a TRIGGER procedure ?
Date
Msg-id AANLkTikRy4wNSwuAYPp0Qip85c0XNmW0xuw4sUDxUtd8@mail.gmail.com
Whole thread Raw
In response to How to iterate fields into a NEW.* RECORD in a TRIGGER procedure ?  (Bruno Baguette <bruno.baguette@gmail.com>)
Responses Re: How to iterate fields into a NEW.* RECORD in a TRIGGER procedure ?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Hello

2010/10/14 Bruno Baguette <bruno.baguette@gmail.com>:
> Hello !
>
> I would like to write a PL/PGSQL trigger that will store changes (Table
> name / Column name / primary key id / OLD value / NEW value) in several
> tables.
>
> As I said, this trigger must be usable for every table (it assumes that
> theses table will have only one primary key).
>
> In order to that, I have to iterate fields into the NEW.*
> How can I do that iteration ?
>
> Many thanks in advance for any tips !
>

look on plperl, plpython or pltcl. You cannot do it simple and well in plpgsql.

Regards

Pavel Stehule


> Regards,
>
> --
> Bruno Baguette
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: pitr question
Next
From: Christian Ramseyer
Date:
Subject: Re: How to search ignoring spaces and minus signs