如何比较 postgres 转储文件?我有两个转储文件, dump1 和 dump2 。我想比较这两个转储文件。
任何帮助将不胜感激..
谢谢
如果使用 windows,您可以使用超越比较,如果使用 linux(fedora),则使用 kompare,如果使用 linux,您可以使用不同的命令,例如此链接sdiff
中提供的示例,其他命令是,等是用于比较的实用程序文件中的文本diff
comm -23 filedump1 fuledump2
sort filedump1 > filedump1.sorted
sort fuledump2 > fuledump2.sorted
diff filedump1.sorted fuledump2.sorted
PostgreSql 的转储文件就像普通的数据文件。你可以使用任何实用程序/工具来查看它们之间的区别。大多数操作系统都为此内置了实用程序
例如:
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 )
我会使用WinMerge来比较模式转储。不会对数据转储进行排序(我刚刚打开了一个关于此的错误报告),但有更好的工具可以做到这一点。
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.