Bill Gribble <grib(at)linuxdevel(dot)com> writes:
> I'm trying to write a fairly generic pl/pgsql trigger function to log
> changes to a specified set of tables into another table.
I'd recommend doing it in C ... the flexibility is there, and the
performance will be better too. There are several examples of C-coded
triggers in contrib:
contrib/fulltextindex/fti.c
contrib/lo/lo.c
contrib/noupdate/noup.c
contrib/spi/autoinc.c
contrib/spi/insert_username.c
contrib/spi/moddatetime.c
contrib/spi/refint.c
contrib/spi/timetravel.c
contrib/tsearch/txtidx.c
Some of these are probably very close to what you want already.
regards, tom lane