'Syncing Schemae using pg_dump and pg_restore
I have two remote postgres databases with dissimilar data. One has latest changes (schema related changes like new columns or tables etc.) and the other is outdated, waiting to be synced. I need to sync the schemae while retaining the data of the outdated one.
What I've done till now is use pg_dump with --schema-only flag and backed up a schema file for the latest database.
Now I don't know if using pg_restore will do the required changes to the outdated database while retaining the data.
I basically want a way to sync schemae of 2 postgres databases using pg_dump and pg_restore commands.
Please let me know if there is an efficient way to do it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
