Re: Before image of selective columns.

Поиск
Список
Период
Сортировка
Искать
От
Scott Ribe
Тема
Re: Before image of selective columns.
Дата
Msg-id
E5FB3E07-51B3-4B6F-B9EF-5D5114648206@elevated-dev.com
Ответ на
Список
Дерево обсуждения
Before image of selective columns. Gambhir Singh <gambhir.singh05@gmail.com>
Re: Before image of selective columns. Laurenz Albe <laurenz.albe@cybertec.at>
Re: Before image of selective columns. Scott Ribe <scott_ribe@elevated-dev.com>
Re: Before image of selective columns. Ron Johnson <ronljohnsonjr@gmail.com>
> On Jan 10, 2025, at 2:55 AM, Laurenz Albe  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...

В списке pgsql-admin по дате отправления
От: Laurenz Albe
Дата:
От: Ron Johnson
Дата:
FAQ