Re: Tracking mutations in table data - Mailing list pgsql-novice

From David G. Johnston
Subject Re: Tracking mutations in table data
Date
Msg-id CAKFQuwY_gKjmyB77S-qyDT+QNqHT5gbxp01pgM5jQpbWdpokSw@mail.gmail.com
Whole thread Raw
In response to Tracking mutations in table data  (Chris Coutinho <chrisbcoutinho@gmail.com>)
List pgsql-novice
On Sun, Apr 5, 2020 at 3:06 PM Chris Coutinho <chrisbcoutinho@gmail.com> wrote:
In addition to the IoT events themselves, I want to log the mutations
in the metadata of each device.

Why?

My question is, what are the best practices regarding tracking this
metadata

Do the simplest thing allowed while ensuring you retain all of the data and an associated timestamp or version.
 
I've done a little research into history tables and
(bi-)temporal tables,

This seems like overkill.
 
and I'm little lost based on all of the options
available. In short, I want some kind of history table of mutations in
the devices table so that I can see when the metadata is
inserted/updated/deleted.

So create one, then populates its contents using insert/update/delete triggers on the observed table.

I'm also hosting this server on a managed Azure instance, which is
somewhat limited in the number and kinds of extensions available.

Triggers are core functionality.

David J.

pgsql-novice by date:

Previous
From: Chris Coutinho
Date:
Subject: Tracking mutations in table data
Next
From: Valentin Czisch
Date:
Subject: PQencryptPasswordConn called using PostgreSQL9.6.