database 如何获取现有数据库的ERD图?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3474389/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get ERD diagram for an existing database?
提问by Badr
I have a PostgreSQL database. I want to get its ERD. How can I do so?
我有一个 PostgreSQL 数据库。我想得到它的 ERD。我怎么能这样做?
采纳答案by rudi-moore
We used DBVisualizerfor that.
我们为此使用了DBVisualizer。
Description:The references graph is a great feature as it automatically renders all primary/foreign key mappings (also called referential integrity constraints) in a graph style. The table nodes and relations are layed out automatically, with a number of layout modes available. The resulting graph is unique as it displays all information in an optimal and readable layout. from its site
描述:引用图是一个很棒的功能,因为它会自动以图形样式呈现所有主/外键映射(也称为引用完整性约束)。表节点和关系会自动布局,并提供多种布局模式。生成的图形是独一无二的,因为它以最佳且可读的布局显示所有信息。 从它的网站
回答by krishnakumarp
You can use dbeaver to do this. It allows you to export the ER diagram as png/svg etc.
您可以使用 dbeaver 来执行此操作。它允许您将 ER 图导出为 png/svg 等。
DBeaver - https://dbeaver.io/
DBeaver - https://dbeaver.io/
Double click on a schema (eg, Schemas->public->Tables) and open the "ER Diagram" tab (next to "Properties" tab)
双击模式(例如,Schemas->public->Tables)并打开“ER Diagram”选项卡(在“Properties”选项卡旁边)
回答by Yasuo Ohgaki
pgModeler can generate nice ER diagram from PostgreSQL databases.
pgModeler 可以从 PostgreSQL 数据库生成漂亮的 ER 图。
- https://pgmodeler.io/
- License: GPLv3
- https://pgmodeler.io/
- 许可证:GPLv3
It seems there is no manual, but it is easy enough without manual. It's QT application. AFAIK, Fedora and Ubuntu has package. (pgmodeler)
好像没有说明书,但是不用说明书也很简单。这是QT应用程序。AFAIK、Fedora 和 Ubuntu 都有包。(pgmodeler)
In the latest version of pgModeler (0.9.1) the trial version allows you to create ERD (the design button is not disabled). To do so:
在最新版本的 pgModeler (0.9.1) 中,试用版允许您创建 ERD(设计按钮未禁用)。这样做:
- Click Design button to first create an empty 'design model'
- Then click on Import and connect to the server and database you want (unless you already set that up in Manage, in which case all your databases will be available to select in step 3)
- Import all objects (it will warn that you are importing to the current model, which is fine since it is empty).
- Now switch back to the Design tab to see your ERD.
- 单击“设计”按钮首先创建一个空的“设计模型”
- 然后单击“导入”并连接到您想要的服务器和数据库(除非您已经在“管理”中进行了设置,在这种情况下,您可以在第 3 步中选择所有数据库)
- 导入所有对象(它会警告您正在导入到当前模型,这很好,因为它是空的)。
- 现在切换回“设计”选项卡以查看您的 ERD。
回答by ankit
Download DbVisualizer from : https://www.dbvis.com/download/10.0
从以下位置下载 DbVisualizer:https://www.dbvis.com/download/10.0
and after installing create database connection:
安装后创建数据库连接:
Change highlighted detail of your db and test by click ping server. Finally click connect
通过单击 ping 服务器更改数据库的突出显示细节并进行测试。最后点击连接
Enjoy.
享受。
回答by WhoIsNinja
I wrote this utility, it automatically generates the DSL code from a postgres database which you can then paste into dbdiagram.io/d website to get ER diagrams
我编写了这个实用程序,它会自动从 postgres 数据库生成 DSL 代码,然后您可以将其粘贴到 dbdiagram.io/d 网站以获取 ER 图表
回答by Kyle Costello
Our team use Visual Paradigm to generate ER diagram from database in many of our projects. While we mainly work on MS SQL and Oracle, as I know they also support some other DBMS like PostgreSQL, MySQL, Sybase, DB2 and SQLite.
我们的团队在我们的许多项目中使用 Visual Paradigm 从数据库生成 ER 图。虽然我们主要研究 MS SQL 和 Oracle,但据我所知,它们也支持其他一些 DBMS,如 PostgreSQL、MySQL、Sybase、DB2 和 SQLite。
Steps:
脚步:
- 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.
- 从 Visual Paradigm 的工具栏中选择 Tools > DB > Reverse Database...
- 保持设置不变,然后单击下一步选择 PostgreSQL 作为驱动程序并在那里提供驱动程序文件。您只需单击那里的下载链接即可获取驱动程序。
- 输入主机名、数据库名、用户和密码,然后单击下一步
- 然后他们将研究您的数据库并列出其中的表。
- 选择表格以形成 ERD 并继续,就是这样。将使用您选择的表格生成 ERD。
BTW they also support generating and updating database schema from ERD.
顺便说一句,他们还支持从 ERD 生成和更新数据库模式。
Hope this helps. :-)
希望这可以帮助。:-)
More information about generating ERD from PostgreSQL database
回答by Yuci
Another option is use Oracle SQL Developer. Two steps as below:
另一种选择是使用Oracle SQL Developer。如下两步:
(1) First of all, you need to connect SQL Developer to your PostgreSQL database.
(1) 首先,您需要将 SQL Developer 连接到您的 PostgreSQL 数据库。
(2) Then you can generate an entity-relationship (ER) diagram using SQL Developer
(2) 然后就可以使用SQL Developer生成实体-关系(ER)图
回答by feliciano popov
ERBuildercan generate ER diagram from PostgreSQL databases (reverse engineer feature).
ERBuilder可以从 PostgreSQL 数据库生成 ER 图(逆向工程功能)。
Below step to follow to generate an ER diagram:
以下步骤可用于生成 ER 图:
? Click on Menu -> File -> reverse engineer
? 点击菜单 -> 文件 -> 逆向工程
? Click on new connection
? 点击新连接
? Fill in PostgresSQL connection information
? 填写PostgresSQL连接信息
? Click on OK
? 点击确定
? Click on next
? 点击下一步
? Select objects (tables, triggers, sequences…..) that you want to reverse engineer.
? 选择要逆向工程的对象(表、触发器、序列……)。
? Click on next.
? 点击下一步。
- If you are using trial version, your ERD will be displayed automatically.
- If your are using the free edition you need to drag and drop the tables from the treeview placed in the left side of application
- 如果您使用的是试用版,您的 ERD 将自动显示。
- 如果您使用的是免费版,则需要从位于应用程序左侧的树视图中拖放表格
回答by dbaOnTap
回答by dbexpert
Perhaps have a look at AquaFold's Aqua Data Studio. It is a database IDE with entity-relationship diagramming. It also includes data profiling. It is not free but its price is very reasonable considering its capabilities.
也许看看 AquaFold 的 Aqua Data Studio。它是一个带有实体关系图的数据库 IDE。它还包括数据分析。它不是免费的,但考虑到它的功能,它的价格非常合理。