Free PostgreSQL ER Diagram Generator
Upload a .sql PostgreSQL dump or paste your DDL and get an interactive entity-relationship diagram in seconds. Supports all modern PostgreSQL syntax including SERIAL, JSONB, TIMESTAMPTZ, and CREATE INDEX.
What PostgreSQL syntax is supported?
GraphMyDB's parser handles the full range of PostgreSQL DDL, including features specific to Postgres that other tools often miss:
SERIAL / BIGSERIAL / SMALLSERIAL
Auto-increment types are detected and shown as constraint badges. Code generation produces correct SERIAL syntax.
CREATE INDEX
Standalone CREATE INDEX statements (including CONCURRENTLY and USING clauses) are parsed and shown in each table's index section.
ALTER COLUMN ... TYPE
PostgreSQL-style ALTER TABLE ... ALTER COLUMN ... TYPE, SET/DROP NOT NULL, and SET DEFAULT are all supported for migration diffs.
GENERATED columns
GENERATED ALWAYS AS IDENTITY and GENERATED BY DEFAULT are parsed and detected as auto-increment.
Double-quoted identifiers
PostgreSQL-style "quoted_name" identifiers are properly handled alongside unquoted names.
PostgreSQL data types
UUID, JSONB, JSON, TIMESTAMPTZ, INTERVAL, CIDR, INET, MACADDR, BYTEA, ARRAY types, and more are all preserved.
Example PostgreSQL schema
Paste this into the tool or upload your own .sql file:
CREATE TABLE authors (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(150) UNIQUE,
bio TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE books (
id BIGSERIAL PRIMARY KEY,
author_id INT NOT NULL REFERENCES authors(id),
title VARCHAR(300) NOT NULL,
isbn VARCHAR(13) UNIQUE,
published_date DATE,
metadata JSONB DEFAULT '{}'
);
CREATE INDEX idx_books_author ON books(author_id);
CREATE TABLE reviews (
id SERIAL PRIMARY KEY,
book_id INT NOT NULL REFERENCES books(id),
reviewer_name VARCHAR(100),
rating SMALLINT CHECK (rating BETWEEN 1 AND 5),
body TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX idx_reviews_book ON reviews(book_id);How it works
Upload or paste
Drop a PostgreSQL .sql dump or paste DDL into the code editor. pg_dump output works directly.
See the diagram
Tables, columns, types (including JSONB, UUID, TIMESTAMPTZ), constraints, indexes, and foreign keys appear as an interactive ER diagram.
Explore and export
Click a table to isolate its relationships, click a column to trace a specific FK, then export as PNG, SVG, SQL, JSON, or Excel.