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


当前回答

Open MySQL Workbench. In the home screen click 'Create EER Model From Existing Database'. We are doing this for the case that we have already made the data base and now we want to make an ER diagram of that database. Then you will see the 'Reverse Engineer Database' dialouge. Here if you are asked for the password, provided the admin password. Do not get confused here with the windows password. Here you need to provide the MySQL admin password. Then click on Next. In the next dialouge box, you'll see that the connection to DBMS is started and schema is revrieved from Database. Go next. Now Select the Schema you created earlier. It is the table you want to create the ER diagram of. Click Next and go to Select Objects menu. Here you can click on 'Show Filter' to use the selected Table Objects in the diagram. You can both add and remove tables here.Then click on Execute.

6.当您点击Next和Finish时,所需的ER图就会出现在屏幕上。

其他回答

pgAdmin 4版本30及更新版本可以从现有数据库生成ERD。只需右键单击数据库并选择Generate ERD。

您可以从PgAdmin生成ER图。

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

我使用DrawERD为ERD和DB文件。https://drawerd.com

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

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