public inbox for [email protected]
help / color / mirror / Atom feedFrom: Ron Johnson <[email protected]>
To: Pgsql-admin <[email protected]>
Subject: Re: Before image of selective columns.
Date: Fri, 10 Jan 2025 09:43:46 -0500
Message-ID: <CANzqJaCUTtUH44C6FJDXJ2ZwFFWjMCQz-pV_QmnVVaUJUhuAhw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAHOGQfV_CHuMJ+yo3YoYCMsajedejRa1=X84shGMSi8CKhCo5Q@mail.gmail.com>
<[email protected]>
<[email protected]>
On Fri, Jan 10, 2025 at 8:41 AM Scott Ribe <[email protected]>
wrote:
> > On Jan 10, 2025, at 2:55 AM, Laurenz Albe <[email protected]>
> 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 when the table definition
> changes? It's not just that you would have to keep the audit table schema
> in sync, it's possible to have a change which is not compatible with the
> old definition, such that you now really can't have one table that covers
> both old and new exactly, and then have to resort to renaming columns or
> some such...
>
For years, we've used triggers to populate such tables, but never had
incompatibility problems. Mainly because we add new columns and upsize
existing columns to compatible types.
Everyone's situation is different, though.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Before image of selective columns.
In-Reply-To: <CANzqJaCUTtUH44C6FJDXJ2ZwFFWjMCQz-pV_QmnVVaUJUhuAhw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox