Abubacker Nainamohamed
Abubacker Nainamohamed

Reputation: 4797

suggest a postgres tool to find the difference between the schema and the data

Dear all ,
Can any one suggest me the postgres tool for linux which is used to find the
difference between the 2 given database

I tried with the apgdiff 2.3 but it gives the difference in terms of schema not the data but I need both !

Thanks in advance !

Upvotes: 2

Views: 3522

Answers (3)

Michal
Michal

Reputation: 1

apgdiff https://www.apgdiff.com/ It's an opensource solution. I used it before for checking differences between differences in dumps. Quite useful

[EDIT] It's for differenting by schema only

Upvotes: 0

Kuberchaun
Kuberchaun

Reputation: 30324

Check out dbsolo DBSOLO. It does both object and data compares and can create a sync script based on the results. It's free to try and $99 to buy. My guess is the 99 bucks will be money well spent to avoid trying to come up with your own software to do this.

Data Compare http://www.dbsolo.com/help/datacomp.html

Object Compare http://www.dbsolo.com/help/compare.html

Upvotes: 2

Michał Niklas
Michał Niklas

Reputation: 54302

Comparing data is not easy especially if your database is huge. I created Python program that can dump PostgreSQL data schema to file that can be easily compared via 3rd party diff programm: http://code.activestate.com/recipes/576557-dump-postgresql-db-schema-to-text/?in=user-186902

I think that this program can be extended by dumping all tables data into separate CSV files, similar to those used by PostgreSQL COPY command. Remember to add the same ORDER BY in SELECT ... queries. I have created tool that reads SELECT statements from file and saves results in separate files. This way I can manage which tables and fields I want to compare (not all fields can be used in ORDER BY, and not all are important for me). Such configuration can be easily created using "dump schema" utility.

Upvotes: 2

Related Questions