Is there a way to find out the last commit value in a table?

I am using Postgres 9.5. If I update some string values ​​and commit, is there a way to get the old value after that? I think there is something like a memory? But that would be a selective memory. I do not want to roll back the entire database. I just need to return one row.

+4
source share
1 answer

The short answer is impossible.

But for future readers, you can create an array field with historical data that will look something like this:

     Column     |           Type           | 
----------------+--------------------------+------
 value          | integer                  | 
 value_history  | integer[]                |

Read docs about arrays for more details

+1
source

Source: https://habr.com/ru/post/1660474/


All Articles