Re: How to iterate fields into a NEW.* RECORD in a TRIGGER procedure ?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Bruno Baguette <bruno(dot)baguette(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to iterate fields into a NEW.* RECORD in a TRIGGER procedure ?
Date: 2010-10-14 09:32:16
Message-ID: AANLkTikRy4wNSwuAYPp0Qip85c0XNmW0xuw4sUDxUtd8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

2010/10/14 Bruno Baguette <bruno(dot)baguette(at)gmail(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Massa, Harald Armin 2010-10-14 10:02:13 Re: querying the version of libpq
Previous Message Rajesh Kumar Mallah 2010-10-14 09:19:13 Re: Gripe: bytea_output default => data corruption