Re: Trigger Function question - Mailing list pgsql-general

From Christophe Pettus
Subject Re: Trigger Function question
Date
Msg-id 870476B2-8403-46F4-BA0F-A03E226B07E3@thebuild.com
Whole thread Raw
In response to Re: Trigger Function question  (DAVID ROTH <adaptron@comcast.net>)
Responses Re: Trigger Function question  (DAVID ROTH <adaptron@comcast.net>)
Re: Trigger Function question  (DAVID ROTH <adaptron@comcast.net>)
List pgsql-general

> On Jul 10, 2023, at 11:29, DAVID ROTH <adaptron@comcast.net> wrote:
>
> I want to use a single trigger function to log multiple tables and the tables have different columns.  I can get the
namesof the columns from the catalog.  But I have not been able to figure out how to get NEW.x when x is not known
untilrun time. 

Unless you only want to log a subset of rows from each table, it's not required that you get the specific columns.
Here'san example of how to do a generic auditing trigger: 

    https://wiki.postgresql.org/wiki/Audit_trigger

If it's supported on your platform, you might also look at the pg_audit extension.


pgsql-general by date:

Previous
From: DAVID ROTH
Date:
Subject: Re: Trigger Function question
Next
From: DAVID ROTH
Date:
Subject: Re: Trigger Function question