Re: hostory tables with a generic function? - Mailing list pgsql-general

From Tom Lane
Subject Re: hostory tables with a generic function?
Date
Msg-id 1409.1092171298@sss.pgh.pa.us
Whole thread Raw
In response to hostory tables with a generic function?  (Raphael Bauduin <raphael.bauduin@be.easynet.net>)
List pgsql-general
Raphael Bauduin <raphael.bauduin@be.easynet.net> writes:
> - is it possible to write only one function used for all logging triggers?

Yes, but it will be very hard and inefficient (maybe even impossible)
in plpgsql.  plpgsql isn't intended for dynamic field access and you'll
really be fighting the language.

I'd suggest writing in C, perhaps after proofing in pltcl.

There are some sample C triggers in the contrib tree that do things
fairly close to this; you might try adapting one of those.

            regards, tom lane

pgsql-general by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: PostgreSQL 8.0.0 Officially Goes Beta
Next
From: Jonathan Barnhart
Date:
Subject: Transaction blocks