How to compare postgres dump files? I have two dump files, dump1 and dump2 . And I want to compare these two dump files.
Any help will be appreciated..
Thank you
How to compare postgres dump files? I have two dump files, dump1 and dump2 . And I want to compare these two dump files.
Any help will be appreciated..
Thank you
PostgreSql's dump files are like normal data files.. you can use any utility/tool to see the difference between them.. Most of the OS has build in utilities for this
For example:
vimdiff dump1 dump2 (http://alvinalexander.com/linux-unix/vimdiff-see-multiple-file-differences-visually)
fc dump1 dump2 (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/fc.mspx?mfr=true)
You can use beyond compare if windows is been used and use kompare if linux(fedora) is been used also if linux is used than you can use different command like sdiff
example is provided in this link, other commands are diff
,comm -23 filedump1 fuledump2
,sort filedump1 > filedump1.sorted
sort fuledump2 > fuledump2.sorted
diff filedump1.sorted fuledump2.sorted
etc are utilities to compare text in files
You could try a simple textual comparison, to start with (diff
command or similar tools).
If you need more than that, there are tools that make database comparisons. For example:
This one compares dumps - but only the schema (not the data).
This one compares data in tables (not from dumps, but from live databases).
Disclaimer: I have not tried them.
I would use WinMerge to compare the schema dumps. Data dumps will not be sorted (I just opened a bug report about this), but there are better tools to do that.