Persist MVCC forever - retain history - Mailing list pgsql-hackers

From Mitar
Subject Persist MVCC forever - retain history
Date
Msg-id CAKLmikOkK+s0V+3Pi1vS2GUWQ0FAj8fEkVj9WTGSwZE9nRsCbQ@mail.gmail.com
Whole thread Raw
Responses Re: Persist MVCC forever - retain history
Re: Persist MVCC forever - retain history
Re: Persist MVCC forever - retain history
Re: Persist MVCC forever - retain history
List pgsql-hackers
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

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Use of "long" in incremental sort code
Next
From: "David G. Johnston"
Date:
Subject: Re: Persist MVCC forever - retain history