Re: Persist MVCC forever - retain history

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Persist MVCC forever - retain history
Date: 2020-07-03 07:29:17
Message-ID: d071247f-6117-f678-fe1e-48082b8b3282@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02.07.2020 21:55, Mitar wrote:
> Hi!
>
> (Sorry if this was already discussed, it looks pretty obvious, but I
> could not find anything.)
>
> I was thinking and reading about how to design the schema to keep
> records of all changes which happen to the table, at row granularity,
> when I realized that all this is already done for me by PostgreSQL
> MVCC. All rows (tuples) are already stored, with an internal version
> field as well.
>
> So I wonder, how could I hack PostgreSQL to disable vacuuming a table,
> so that all tuples persist forever, and how could I make those
> internal columns visible so that I could make queries asking for
> results at the particular historical version of table state? My
> understanding is that indices are already indexing over those internal
> columns as well, so those queries over historical versions would be
> efficient as well. Am I missing something which would make this not
> possible?
>
> Is this something I would have to run a custom version of PostgreSQL
> or is this possible through an extension of sort?
>
>
> Mitar
>
Did you read this thread:
https://www.postgresql.org/message-id/flat/78aadf6b-86d4-21b9-9c2a-51f1efb8a499%40postgrespro.ru
I have proposed a patch for supporting time travel (AS OF) queries.
But I didn't fill a big interest to it from community.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-07-03 07:54:40 Re: max_slot_wal_keep_size and wal_keep_segments
Previous Message Peter Eisentraut 2020-07-03 07:08:26 Re: SEARCH and CYCLE clauses