建议使用 postgres 工具来查找模式和数据之间的差异
亲爱的大家,
任何人都可以建议我使用 Linux 的 postgres 工具来查找
2个给定数据库之间的差异
我尝试使用apgdiff 2.3,但它给出了模式而不是数据方面的差异 但我两者都需要!
提前致谢 !
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 !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
比较数据并不容易,尤其是当您的数据库很大时。我创建了 Python 程序,可以将 PostgreSQL 数据模式转储到文件,可以通过第 3 方 diff 程序轻松进行比较: http://code.activestate.com/recipes/576557-dump-postgresql-db-schema-to-text/?in=user-186902< /a>
我认为可以通过将所有表数据转储到单独的 CSV 文件中来扩展该程序,类似于 PostgreSQL
COPY
命令使用的文件。请记住在SELECT ...
查询中添加相同的ORDER BY
。我创建了从文件中读取 SELECT 语句并将结果保存在单独文件中的工具。这样我就可以管理要比较的表和字段(并非所有字段都可以在ORDER BY
中使用,并且并非所有字段对我都很重要)。可以使用“转储模式”实用程序轻松创建此类配置。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 sameORDER BY
inSELECT ...
queries. I have created tool that readsSELECT
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 inORDER BY
, and not all are important for me). Such configuration can be easily created using "dump schema" utility.查看 dbsolo DBSOLO。它进行对象和数据比较,并可以根据结果创建同步脚本。可免费试用,购买价格为 99 美元。我的猜测是 99 美元花得值,因为您可以避免尝试开发自己的软件来完成此任务。
数据比较
http://www.dbsolo.com/help/datacomp.html
对象比较
http://www.dbsolo.com/help/compare.html
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
apgdiff https://www.apgdiff.com/
这是一个开源解决方案。我之前用它来检查转储差异之间的差异。相当有用
[编辑]
它仅用于通过模式进行区分
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