i have two postgres databases on different servers. Both have a 'public schema' with the same tables inside. One of them is used for developing and I am creating new tables of new columns inside some tables. How can i pg_dump the developing DB structure in order to get a sql that i run on the second DB to create the missing columns / tables (and constraints if possible)
-
So you want a dump as a diff, so it would only change the columns and other items that have changed? For that you need a third party library, for which you might get suggestions at softwarerecs.stackexchange.comSami Kuhmonen– Sami Kuhmonen2015-05-15 15:10:56 +00:00Commented May 15, 2015 at 15:10
Add a comment
|
2 Answers
I doubt if it's possible with pg_dump.
However, you can use Liquibase. It's a database versioning tool which also allow to generate diff of given two databases.
Have a look at:
Comments
For this case exist few tool with same functional
http://pgdiff.sourceforge.net/
https://github.com/fordfrog/apgdiff
this is utilities full cover you requirements
and you can use this for make you own tool
pg-diff - python tool to diff to schemas https://github.com/brendonh/schemup