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