Archiving records from PostgreSQL database that surpass timeline Archiving records from PostgreSQL database that surpass timeline database database

Archiving records from PostgreSQL database that surpass timeline


This is an area where logical replication (something like Bucardo or Slony) can really help, since you can replicate only the tables you want and maintain your own triggers around them. In this case you could have update and delete triggers to archive old versions of the data so you can look over it.

Of course you can also do this with triggers in your production database and then use foreign data wrappers as the comment suggests. But if you are going that route, you might also consider copying to csv and the loading so you have an air gap and an do transformations if eventually required.