Are there any free tools to generate table diagrams with PostgreSQL?
-
8Since this question got closed, I asked on the software recommendation SE: Generate database table diagrams from a PostgreSQL databaseFranck Dernoncourt– Franck Dernoncourt2016-07-09 21:46:03 +00:00Commented Jul 9, 2016 at 21:46
-
1Would be better and helpful to add a suggestion on what appropriate site under Stack Exchange communities to ask.Jeb50– Jeb502021-06-07 18:47:12 +00:00Commented Jun 7, 2021 at 18:47
-
In one word, dbeaver. Works out of the box. Also, you can refer to wiki.postgresql.org/wiki/Design_Toolsivorynoise– ivorynoise2022-04-20 12:58:56 +00:00Commented Apr 20, 2022 at 12:58
-
One great solution would be using intellij idea / datagrip's: Right-click on the database's table name > Diagram > Show Visualization -> Some icon in the top for Export Diagram > Open in Web Editor > (Choose whichever you like more)forhadmethun– forhadmethun2022-10-27 23:42:59 +00:00Commented Oct 27, 2022 at 23:42
7 Answers
I love schemaspy for schema visualisations. Look at the sample output they provide, and drool. Note the tabs!
You'll need to download the JDBC driver here, then your command should look something like:
java -jar schemaspy-6.0.0-rc2.jar -t pgsql -db database_name -host myhost -u username -p password -o ./schemaspy -dp postgresql-9.3-1100.jdbc3.jar -s public -noads
Sometimes using options -port will not working if your database has diferrent port, so you have to add manual port after host parameter, for example:
java -jar schemaspy-6.0.0-rc2.jar -t pgsql -db database_name -host myhost:myport -u username -p password -o ./schemaspy -dp postgresql-9.3-1100.jdbc3.jar -s public -noads
You'll need to install graphviz as well if you want graphics (apt-get install graphviz for debian based distros).
14 Comments
graphviz just append the -gv /path_to/graphviz to the commanddocker run -v `pwd`/diagram:/output schemaspy/schemaspy:snapshot -t pgsql --port 5432 -u postgres -db <dbname> -host docker.for.mac.localhost -p <password>SchemaCrawler for PostgreSQL can generate database diagrams from the command line, with the help of GraphViz. You can use regular expressions to include and exclude tables and columns. It can also infer relationships between tables using common naming conventions, if not foreign keys are defined.
Comments
Quick solution I found was inside the pgAdmin program for windows. Under Tools menu there is a "Query Tool". Inside the Query Tool there is a Graphical Query Builder that can quickly show the database tables details. Good for a basic view
4 Comments
Just found http://www.sqlpower.ca/page/architect through the Postgres Community Guide mentioned by Frank Heikens. It can easily generate a diagram, and then lets you adjust the connectors!
1 Comment
PostgreSQL Autodoc has worked well for me. It is a simple command line tool. From the web page:
This is a utility which will run through PostgreSQL system tables and returns HTML, Dot, Dia and DocBook XML which describes the database.
5 Comments
dot -Tpng my_database.dot -o my_database.png.Inside Eclipse I've used the Clay plugin (ex Clay-Azurri). The free version allows to introspect ("reverse engineer") an existing DB schema (via JDBC) and make a diagram of some selected tables.