SQL to ER Diagram
Home › PostgreSQL

PostgreSQL to ER Diagram

Paste your PostgreSQL schema — CREATE TABLE statements or a pg_dump — and get an interactive ER diagram with every table, column and foreign key drawn for you.

Open the diagram tool →
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link

How it works

  1. Dump the schema with pg_dump --schema-only your_db, or copy your CREATE TABLE statements.
  2. Paste it into the editor — Postgres is parsed automatically, including ALTER TABLE … ADD CONSTRAINT foreign keys.
  3. Tables render with columns and types; relations are drawn from the constraints.
  4. Arrange, hide tables, then export PNG/SVG or share a link.

Example

A PostgreSQL schema like this:

CREATE TABLE customers (
  id SERIAL PRIMARY KEY,
  email TEXT NOT NULL UNIQUE
);

CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  customer_id INTEGER NOT NULL REFERENCES customers(id)
);

…renders two tables with a relation from orders.customer_idcustomers.id. Try it with your own →

Why use it

PostgreSQLpg_dumpMySQLSQLitePrisma

FAQ

How do I turn a Postgres database into an ER diagram?

Run pg_dump --schema-only and paste the output. Tables and foreign keys (including those added via ALTER TABLE) are drawn automatically.

Does it support pg_dump?

Yes — pg_dump emits foreign keys as separate ALTER TABLE statements, which are parsed and turned into relations.

Is my schema uploaded anywhere?

No. Everything runs locally in your browser — your schema is never uploaded to or stored on any server.

Can I export the diagram?

Yes — export a high-resolution PNG or vector SVG, copy the schema as Mermaid, DBML or PlantUML, or share a link that encodes the whole diagram in the URL.

Is it free?

Yes. It is completely free and open source, with no account or sign-up required.

Related