Re: access to new/old in dynamic sql for audit table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jay Parker <jbparker(at)ualr(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: access to new/old in dynamic sql for audit table
Date: 2005-06-08 16:27:26
Message-ID: 3960.1118248046@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jay Parker <jbparker(at)ualr(dot)edu> writes:
> I am revisiting the age-old audit table issue, and am curious to see
> whether I can get away with not writing custom trigger functions for
> every table being audited.

You can't do it nohow in plpgsql. I believe it's relatively simple in
pltcl or plperl, though, because those languages don't try to precompile
column references.

Or if you're feeling bold, you could write the trigger in C ;-).
There are some examples that do pretty similar stuff in contrib/spi/.
If performance is a big concern this would be a good plan anyway.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rajesh Kumar Mallah 2005-06-08 17:20:12 Re: plpgsql dynamic record access
Previous Message Jay Parker 2005-06-08 15:54:12 access to new/old in dynamic sql for audit table