Comparing two postgres dump files

雨燕双飞 提交于 2019-12-05 01:31:57

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:

  • linux:

vimdiff dump1 dump2 (http://alvinalexander.com/linux-unix/vimdiff-see-multiple-file-differences-visually)

  • On Windows:

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!