This was harder than it should have been so I’m documenting it.
java -jar <schemaspy jar> -t pgsql -db <database name> -u <user> -host localhost -o <output directory> -s "public" -dp <jdbc driver>
for a remote database (say on Amazon RDS) try
java -jar <schemaspy jar> -t pgsql -db <database name> -u <user> -p <password> -host foo.bar.region.rds.amazonaws.com -o <output directory> -s "public" -dp <jdbc driver>
If you get a complaint about the schema, it defaults to the username, pass in the correct schema name after
now you can open
<output directory>/index.html to get amazing info on your postgres database.
Above is the output for the dellstore2 datamodel. You can drill down to focus on a single table and its relationships. Let’s isolate ‘Orders’.
You can test it out yourself dellstore SchemaSpy.
Hopefully someday I’ll be able to get a postgres schema to load in wwwsqldesigner but I couldn’t figure it out. This way I could send my friends a link to my data model.