Developer

Runs in your browser. No file uploads for processing.

SQL Schema Map & Diff

Turn PostgreSQL CREATE TABLE text into a key relationship map, compare two definitions and export a Mermaid diagram without connecting to a database.

Loading tool...

How to compare PostgreSQL table definitions

  1. Paste a CREATE TABLE schema

    Paste supported definitions into Baseline. For a comparison, paste another full set into Candidate. The example maps customers, orders and shipments.

  2. Review keys, relationships and differences

    See columns, types, nullable flags, primary keys and inline or table-level foreign keys. Review omissions before using the diff.

  3. Export your map

    Switch between the baseline and candidate diagram, then download Mermaid source or copy it for documentation.

Use cases

  • Compare a small migration review snapshot for changed column types and foreign-key actions.
  • Create a relationship diagram from a few PostgreSQL table definitions for documentation without exposing live data or credentials.

Limits and privacy

  • Bounded PostgreSQL CREATE TABLE subset: 72,000 characters, 40 tables, 600 total columns and 120 foreign keys per input.
  • Not a SQL validator or migration generator. ALTER TABLE, views, indexes, partitioning, inheritance expansion, triggers, defaults, generated expressions, and non-key constraints are not compared.
  • Uses public for unqualified names. Does not interpret search_path, infer renamed tables, canonicalize every type alias, or verify live database constraints.

The tool processes inputs in your browser. Account features and usage analytics are separate.

Frequently asked questions

Should I format a long SQL schema before inspecting relationships?

SQL Formatter can make a long schema easier to read. This mapper extracts relationships from supported PostgreSQL CREATE TABLE syntax for local visual review.

Will this execute any of my SQL?

No. It analyzes pasted text inside your browser, does not connect to a database, and does not generate or apply a migration.

Which changes can it report?

It reports added and removed tables and columns, changes to column types and nullability, primary key changes, and detected foreign key changes.

Does it support an entire PostgreSQL dump?

Not completely. The tool reads a bounded CREATE TABLE subset, reports skipped statements and unsupported options, and does not infer later ALTER TABLE changes.

Can I save the schema diagram?

Yes. Download a Mermaid source file for the selected schema or copy it to your clipboard.

Related tools