Compare two postgreSQL databases

2

I need to compare two postgresql databases, I have a database in development and I must pass it to production but I need to see all the changes that have been made. I have used apgdiff but the expected result is not displayed.

I am running the cmd as follows:

and when executing it, the following is presented:

Thank you.

    
asked by Carmen A. 03.10.2017 в 16:44
source

1 answer

0

I hope it helps you so I use it I leave you an example

database structure in production:

 pg_dump --host localhost --port 5432 -U postgres  --format plain --schema-only  -f  tmp/productionv1.sql dell

developing database structure:

pg_dump --host localhost --port 5432 -U postgres  --format plain --schema-only  -f  tmp/developer2.sql dell

Once you have the exported databases, apgdiff is told to detect the changes made to apply them in production, example:

java -jar apgdiff-2.4.jar productionv1.sql developer2.sql > cambios.sql

As you know apgdiff is done in java once you execute it you would have the file changes.sql with the changes where it would only be adding them wherever you want

    
answered by 03.10.2017 в 17:01