Tracking mutations in table data

Поиск
Список
Период
Сортировка
От Chris Coutinho
Тема Tracking mutations in table data
Дата
Msg-id CAG+YirQg=4846+XEO0zRBUL52PjQ=MPmsyTV8Fid8nvNGGzMZg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Tracking mutations in table data
Re: Tracking mutations in table data
Список pgsql-novice
Hi all,

Relatively new to PostgreSQL, looking for guidance.

I have a schema that looks like this, it's being used to log IoT events:

create table devices (
    id serial primary key,
    meta1 int,
    meta2 text
)

create table events (
    datetime timestamp,
    device_id int references devices (id),
    code int,
    primary key (datetime, device_id)
)

In addition to the IoT events themselves, I want to log the mutations
in the metadata of each device. The metadata of each device changes
much less frequently than the rate at which events are inserted,
that's why I've opted to place the data into the devices table.

My question is, what are the best practices regarding tracking this
metadata? I've done a little research into history tables and
(bi-)temporal tables, 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.

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

Thanks in advance,
Chris



В списке pgsql-novice по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: chr(3) and 3::text
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Tracking mutations in table data