postgres compare databases - ghdrako/doc_snipets GitHub Wiki

In PostgreSQL, each database is an isolated environment. A connection string must pick a target database, and it’s not possible for one database to interact with objects from another one, because catalogs are kept separated.

There are several tools out there:

(note that most of these tools can only compare structure, but not data)

Free Ones:

pgquarrel: http://eulerto.github.io/pgquarrel (schema diff)
apgdiff http://apgdiff.com/ (schema diff)
Liquibase (Cross DBMS): http://www.liquibase.org/ (schema diff)
pgAdmin https://www.pgadmin.org/ (schema diff in pgAdmin4)
WbDataDiff (Cross DBMS): http://www.sql-workbench.net/manual/compare-commands.html#command-data-diff (data diff)
WbSchemaDiff (Cross DBMS): http://www.sql-workbench.net/manual/compare-commands.html
Migra https://migra.djrobstep.com/ (schema diff)

Commercial:

DB Comparer: http://www.sqlmanager.net/en/products/postgresql/dbcomparer
Aqua Data Studio: http://docs.aquafold.com/docs-diff-schema.html
DB Solo: http://www.dbsolo.com/index.html (30 day trial)
PostgresCompare: https://www.postgrescompare.com/ (14 day trial, compares schema and data)