0

I am having some data in some tables of my database which gets update rarely that data I need to transfer from my local to live only some rows that are updated. and if possible want to preserve previous data on live as well by making it inactive. I need to do row level data versioning is it possible?

I searched but didn't found anything found that postgresql only allow two type of back up physical and logical and row level versioning I am not able to find anywhere. Do I need to write code for doing this versioning? in which language? Please help.

charmi
  • 197
  • 3
  • 17

1 Answers1

0

You can add a column of version number and update it accordingly but you have to make change to your application side code that will retrieve only Latest version data.

If you don't want to do application level changes than make an audit table and make trigger so that changes you do you have previous data in audit table always stored with you.

As you have only some tables that modifies rarely so 2nd solution will be good idea. below is a link that will provide you with an example

https://www.boxever.com/automatic-auditing-versioning-postgresql/

Hope this helps.

charmi
  • 197
  • 3
  • 17