Skip to content

Instantly share code, notes, and snippets.

@absk1317
Created October 30, 2018 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save absk1317/940dc671a40f3354bd50324e51460bf1 to your computer and use it in GitHub Desktop.
Save absk1317/940dc671a40f3354bd50324e51460bf1 to your computer and use it in GitHub Desktop.

SchemaSpy is a neat tool to produce visual diagrams for most relational databases.

Here's how to use it to generate schema relationship diagrams for PostgreSQL databases:

  1. Download the jar file from here (the current version is schemaSpy_5.0.0.jar)

  2. Get the PostgreSQL JDBC driver (either the JDBC3 or JDBC4 jar file is fine)

  3. Run the command against an existing database. For most databases, the schema (-s option) we are interested in is the public one:

java -jar schemaSpy_5.0.0.jar -t pgsql
-s public -db [db name] -u [db user] -p [password]
-host localhost -o /tmp
-dp /path/to/JDBC/driver/postgresql-9.4-1200.jdbc4.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment