1

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)

1
  • 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.com Commented May 15, 2015 at 15:10

2 Answers 2

0

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:

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.