I have Postgresql 9.3 server on both my laptop and my desktop at home. I keep identical data on both system. Sometimes I work on the database on my laptop while other times I work on the database on the desktop. I want to make sure that the data and structure of both the laptop and desktop versions of the databases remain in sync. I don't need them to be hot swappable or anything, but just need to sync them once a day or once every two days.

So my question is whether log shipping is a good way to keep both databases in sync for periodic synchronizations? Or is this a bad choice since the laptop database cannot always access the desktop database from a remote location.


It is a creative way of thinking. If you know how to handle role exchanges (promoting to primary) and do this often, it could work but I am not sure it makes you happy. Especially not because there is a bug where WALL files are prematurely recycled which makes re establishing the old primary as a slave a pain. (this is fixed in May 2020)

Since you want to be able to work on both(I assume read and write) you have a challenge. You can only have one writable db in a replication pair.

My choice - as a dba who does this kind f things regularly - would be to set up a little RDS instance in Amazon or similar so you can access the database always, if you have a network available. It would be different if you only need writes to one db and the others only has reads. In that case: go ahead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.