我有一个PostgreSQL数据库。我想从数据库中生成ERD。有没有内置工具或者第三方工具?


当前回答

为此我们使用了DBVisualizer。

描述: 引用图是一个很好的特性,因为它自动以图形样式呈现所有主键/外键映射(也称为引用完整性约束)。表节点和关系是自动布局的,有许多可用的布局模式。生成的图形是唯一的,因为它以最佳且可读的布局显示所有信息。 来自网站

其他回答

从https://www.dbvis.com/download/10.0下载DbVisualizer

安装完成后,创建数据库连接:

通过单击ping服务器更改数据库的高亮显示细节和测试。最后点击连接

享受。

另一种选择是使用Oracle SQL Developer。分为以下两步:

首先,你需要将SQL Developer连接到PostgreSQL数据库。

然后你可以使用SQL Developer生成一个实体-关系(ER)图

Postgresql_autodoc是执行此操作的cli。不做基数,但上面提到的GUI工具都不做。

我写了这个实用程序,它自动从postgres数据库生成DSL代码,然后你可以将其粘贴到dbdiagram中。io/d网站获取ER图表

https://github.com/nsingla/dbdiagrams

在我们的许多项目中,我们的团队使用Visual Paradigm从数据库中生成ER图。虽然我们主要在MS SQL和Oracle上工作,但据我所知,他们也支持一些其他的DBMS,如PostgreSQL, MySQL, Sybase, DB2和SQLite。

步骤:

Select Tools > DB > Reverse Database... from the toolbar of Visual Paradigm Keep the settings as is and click Next Select PostgreSQL as driver and provide the driver file there. You can simply click on the download link there to get the driver. Enter the hostname, database name, user and password, and then click Next They will then study your database and lists out the tables in it. Select the table to form an ERD and continue, and that's it. An ERD will be generated with the tables you selected presented.

顺便说一下,它们还支持从ERD生成和更新数据库模式。

希望这能有所帮助。: -)

更多关于从PostgreSQL数据库生成ERD的信息