Re: Before image of selective columns. - Mailing list pgsql-admin

From Scott Ribe
Subject Re: Before image of selective columns.
Date
Msg-id E5FB3E07-51B3-4B6F-B9EF-5D5114648206@elevated-dev.com
Whole thread Raw
In response to Re: Before image of selective columns.  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Before image of selective columns.
List pgsql-admin
> On Jan 10, 2025, at 2:55 AM, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> That looks like a job for a trigger; perhaps a statement level trigger
> with a transition table.

Indeed.

I just want to add from experience: put the row values into a JSON column in the audit table. Otherwise, what do you do
whenthe table definition changes? It's not just that you would have to keep the audit table schema in sync, it's
possibleto have a change which is not compatible with the old definition, such that you now really can't have one table
thatcovers both old and new exactly, and then have to resort to renaming columns or some such... 


pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Before image of selective columns.
Next
From: Ron Johnson
Date:
Subject: Re: Before image of selective columns.