Taking incremental pg_dump since last restore

80 Views Asked by At

We are developing a large application and all our tests are based on a reference Test DB. This test DB is initially loaded by executing different scripts and you can add your own script to add more data.

I want to ease the following flow

  • I have loaded the test DB
  • I do some data modifications to the DB indirectly (e.g by just using the application)
  • I can generate a SQL script of the data modification

I am looking for the most efficient way to do it. So far my best solution is:

  1. I load the test DB under an other name
  2. I take a pg_dump in sql format of the vanilla test DB and the modified one
  3. I do a diff of both pg_dump output

This not really great because:

  • Loading test DB takes time and space
  • Test DB has some time information which will pollute the diff (e.g tables with created_date column)

Any better solution?

0

There are 0 best solutions below