pgquery

pgquery / Postgres ER diagram

Chapter 6 · Schema map

An ER diagram of your Postgres schema, drawn from the database

Connect, open Schema Map, and pgquery draws every table and foreign key in the schema. Drag tables where you want them, then export the result as a plate to print or share.

From the catalog, not from guesses

The diagram is built from pg_catalog: tables, columns, primary keys and foreign key constraints. Nothing to annotate, and it is always current.

Arrange it

Drag tables, pan and zoom. Lines follow the foreign keys so you can trace how orders reach customers or tracks reach artists.

Export a plate

Export plate saves the diagram as an SVG or a 2× PNG with a title block: database and schema name, table and relationship counts, and the date. It is sized to drop into a design doc, a README or an onboarding page, or to print and pin up.

Questions

Does it work with large schemas?

Yes. Pick one schema at a time; you can pan and zoom around large diagrams.

Is the export editable?

The SVG is plain vector markup, so you can open it in Figma, Inkscape or Illustrator.

More chapters