Generate the ERD for an existing database
Solution 1
We used DBVisualizer for that.
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
Solution 2
You can use dbeaver to do this. It allows you to export the ER diagram as png/svg etc.
DBeaver - https://dbeaver.io/
Double click on a schema (eg, Schemas->public->Tables) and open the "ER Diagram" tab (next to "Properties" tab)
Solution 3
pgAdmin 4 version 30 and newer can generate the ERD from an existing database. Just right-click on the database and select Generate ERD.
Solution 4
pgModeler can generate nice ER diagram from PostgreSQL databases.
- https://pgmodeler.io/
- License: 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)
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:
- 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.
Solution 5
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
Related videos on Youtube
Badr
I am a java enthusiast with 6 years of J2EE development experience, it includes development of custom frameworks and working with famous frameworks like Spring, Hibernate, Jersey etc. I also love to work as a full stack developer with Java as server side technology and HTML5, CSS3 and Javascript for front end development. For front end I like work with angular.js and backbone.js and for styling My choice is less css. I am reachable at [email protected]
Updated on December 23, 2021Comments
-
Badr over 2 years
I have a PostgreSQL database. I want to generate ERD from that database. Are there any built-in tools to do it or maybe some third-party tools?
-
Badr over 13 yearsi want to visualize the relationships between tables of the existing schema
-
09Q71AO534 over 10 years@ALL is there any add-on for pgadmin III to get the ER-Diagrams done as this Video in this Link Says .
-
ntg almost 3 yearscheck this out... softwarerecs.stackexchange.com/questions/34552/…
-
-
Frank Heikens over 11 yearsDoesn't work for PostgreSQL or other databases, it's MySQL-only
-
Victoria Stuart about 6 yearsSecond this! While l I generally prefer the psql terminal, at times I also use DBeaver CE (Community Edition; dbeaver.jkiss.org/download ; an excellent, free and open source platform) for viewing data and visualizing the ERDs.
-
Adam Lehenbauer about 6 yearsI don't see any options like this, pgAdmin 4, version 2.1. There is no "select statement" or "statement" in the context menu for a table
-
honor almost 6 yearsJust installed DBeaver and was able to get the E-R diagram of my database. A tool that works. If you have more than 100 tables, then the generated E-R diagram will need some manual arrangement though...
-
qräbnö almost 6 years404 Ooops! That page doesn't exists.
-
Jose1755 almost 6 yearsThe free Community version does have this feature available
-
denis.peplin over 5 yearsNot that easy. "Design" button is disabled, and there are no hints how to enable it.
-
Andrey Kotov over 5 yearsThanks, works for me. After you are connected - double-click on 'TABLE' and go to 'References' tab. Here is the link for details.
-
dpmott almost 5 yearsHere's the DBeaver ER Diagrams wiki page, which includes helpful tips for layout and exporting to image file format:
-
Jose V over 4 yearsAnd it is opensource, meanwhile the accepted answer is for a product (DBVisualizer) that gives a limited trial and after you need to purchase a license
-
jhnatr over 4 yearsTo find the graph in postgres, I had to click into the schema, then click TABLE, and, in the window on the right, click the 'References' tab. This feature is available in the free version, too.
-
Lucio Mollinedo over 4 yearsThis tool just works. Unlike the accepted answer. Thank you for this.
-
tandrewnichols about 4 yearsStarted with DBVisualizer because it was higher on the page, but this is CLEARLY the right answer here. DBVisualizer's free version is immensely limited AND it looks like it was designed by a DBA in 1992. Meanwhile DBeaver, while not a design marvel, is quite nice looking, and the ERDs it generates are SIGNIFICANTLY easier to read/follow/look at.
-
Mauricio almost 4 yearsJust point out that DBeaver Community Edition allows : double click on table to open ER diagram limited to related tables ; save manual arrangements you do to each autogenerated ER diagram ; create custom diagrams (.erd files) with a subset of tables ; add table to existing diagrams and auto add relationships ; export diagrams as .png
-
Diego Frehner almost 4 yearsMaybe this is a temporary problem, but the tool was unusable for me in v 11.0.4 on Win 10. The GUI had drawing problems which makes it unable to use.
-
Learner over 3 yearsConsider the perfect answer below too
-
ceving over 3 yearsIt is a pain to configure a proxy server in DBeaver.
-
ceving over 3 yearspgModeler seems to be the only one, which supports table inheritance.
-
ceving over 3 yearsThis tool does not support Postgres' table inheritance. Parent and child tables are shown in the diagram without any visual relation.
-
ceving over 3 yearsNo open source. Just 15 days trial.
-
Nícolas Iensen about 3 yearsI just tried the ERD feature of DBeaver, and it is awesome!
-
Alan47 about 3 yearsI just tried it (on a small DB with 5 tables) and it seems to work fairly well!
-
GeoGyro about 3 yearsGood start but that doesn't generate everything. It would be usefull to also design views for example.
-
Shahid about 2 yearsCan we generate ERD for some tables ?