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


当前回答

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

https://github.com/nsingla/dbdiagrams

其他回答

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

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

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

您可以从PgAdmin生成ER图。

打开PgAdmin 右键单击任何表并选择语句,它将显示两个窗口,一个是查询,另一个是图形窗口,因此您可以添加您想要生成图表的表。 保存方法:另存为,选择图形查询(图像)

ERBuilder可以从PostgreSQL数据库生成ER图(反向工程特性)。

生成ER图的步骤如下:

•点击菜单->文件->逆向工程

•点击新建连接

•填写PostgresSQL连接信息

•点击确定

•点击“下一步”

•选择你想要逆向工程的对象(表,触发器,序列.....)。

•点击下一步。

如果您使用的是试用版,则会显示您的ERD 自动。 如果你使用的是免费版,你需要拖动 并从应用程序左侧的树视图中删除表

也许可以看看AquaFold的Aqua Data Studio。它是一个具有实体关系图的数据库IDE。它还包括数据分析。它不是免费的,但考虑到它的功能,它的价格是非常合理的。

在我们的许多项目中,我们的团队使用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的信息