Answer the question
In order to leave comments, you need to log in
How to quickly roll back changes in postgres without restoring the dump?
How can I roll back the last changes made in the database? Suppose some complex script is being finalized that will make changes, after its execution it turns out that the script does not work as it should and after the code is finalized, it needs to be run on the same data set that was before the changes. The option to make a dump and recover from it is not suitable, the dump is very large. I would like to be able to quickly execute the script and quickly go back and iterate in this way, finding things that worked incorrectly.
Answer the question
In order to leave comments, you need to log in
It is logical to copy the postgres base files, and in case of failure to upload them back, the files are copied even to ssd at a speed of more than 100 megabytes per second, not to mention ssd.
Nothing seems to be faster than this.
Another option is to make copies of the database in the background and experiment with them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question