13

如何比较 postgres 转储文件?我有两个转储文件, dump1 和 dump2 。我想比较这两个转储文件。

任何帮助将不胜感激..

谢谢

4

4 回答 4

2

如果使用 windows,您可以使用超越比较,如果使用 linux(fedora),则使用 kompare,如果使用 linux,您可以使用不同的命令,例如此链接sdiff中提供的示例,其他命令是,等是用于比较的实用程序文件中的文本diffcomm -23 filedump1 fuledump2sort filedump1 > filedump1.sorted sort fuledump2 > fuledump2.sorted diff filedump1.sorted fuledump2.sorted

于 2014-12-01T10:31:20.963 回答
1

PostgreSql 的转储文件就像普通的数据文件。你可以使用任何实用程序/工具来查看它们之间的区别。大多数操作系统都为此内置了实用程序

例如:

  • linux:

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

  • 在 Windows 上:

fc dump1 dump2 ( http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/fc.mspx?mfr=true )

于 2014-06-17T07:15:45.983 回答
0

我会使用WinMerge来比较模式转储。不会对数据转储进行排序(我刚刚打开了一个关于此的错误报告),但有更好的工具可以做到这一点。

于 2011-04-19T15:46:05.933 回答
-2

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.

于 2011-04-19T14:09:11.587 回答