Postgres: Merge database backup with development database My database is quite large 50GB+ what I've always had to do when I want to sync my development database with production is download a backup of production, drop my development database then restore the production database on my development machine.

Is there any way of doing a (Sync/merge) where only new data is added?
What I do is keep two copies of production on my test machine.  At 50GB, that should be pretty doable.  When I want a fresh copy of production, all I have to do is:

pg_ctl stop -D $WHERE/dev -mi
rm $WHERE/dev/* -r
mv $WHERE/pre_stage/* $WHERE/dev
cp $WHERE/recovery.sample $WHERE/dev/recovery.conf
pg_ctl start -D $WHERE/dev
tar xf /mnt/something/latest/base.tgz -C $WHERE/pre_stage &amp;


It takes anywhere from a few seconds to a few minutes, depending on how much WAL log has been generated since the last base backup was taken.  The last step of replenishing the pre_stage takes longer, but it doesn't matter since I don't have to sit around and wait for it to finish.

Of course this requires you to be using log archiving on the production machine.  I would be doing that anyway, though.