PGQViewer

See your Postgres data as a living graph.

PostgreSQL 19 can describe graphs over the tables you already have. PGQViewer connects to your database, lets you write a short pattern, and draws the result on a canvas you can click around — no extensions, no data copying, no separate graph database to run.

docker run --rm -p 127.0.0.1:8080:8080 -v pgqviewer-data:/data aondev/pgqviewer:latest

Free & open source · Apache-2.0 · pull & run with Docker

social · graph modelayout: fcose
MATCH(a IS person)-[k IS knows]->(b IS person)
An interactive property graph: people (Alice, Bob, Carol, Dave) connected by “knows” edges, acting in movies (Dune, Arrival, Sicario) that belong to genres (Sci-Fi, Thriller), with a studio (Legendary) that produced them.
personmoviegenrestudio10 nodes · 14 edges · 2 ms

// the idea

Your tables already describe a graph.

With SQL/PGQ, a graph is just a description laid over tables you already have — the same rows, viewed as nodes and edges. Nothing to migrate, nothing to copy. PGQViewer reads that description from the catalog and draws it for you.

what you store

people
1Alice
2Bob
3Carol
knows (src → dst)
1→2 · 2→3 · 1→3
GRAPH_TABLE

what you see

AliceBobCarolDune

// features

Built for exploring, not configuring.

PGQViewer is deliberately small. It shows you the graph that's already in your database — drawn accurately — and otherwise stays out of your way.

two modes

Start with a pattern, drop into SQL anytime

In graph mode you write a MATCH pattern and PGQViewer fills in the rest — there's even a WHERE pane for filtering. Need more? Switch to SQL mode and run verbatim PostgreSQL — joins, CTEs, EXPLAIN — into a sortable table.

GraphSQL
(a IS person)-[k IS knows]->(b IS person)WHERE a.born > 1985

exploration

Follow the connections

Hover or double-click a vertex to pull in everything it links to. New nodes settle in around it and merge on identity, so you can grow the graph without rewriting your query.

correctness

It won't draw a wrong graph

PostgreSQL will happily accept graph definitions that can't be drawn faithfully — non-unique keys, edges whose REFERENCES don't line up. PGQViewer checks for these when you connect and tells you exactly what to fix.

socialready
people.id · non-unique KEY → fix

make it readable

Read the graph however you like

Recolour and caption labels, choose which property shows on each node, map edge thickness to a value, and switch palettes or themes. Whatever you set, PGQViewer remembers it next time.

caption:name
light / dark

fourteen layouts

A shape for every dataset

Force-directed for messy clusters, hierarchical for trees, concentric for hubs — pick whatever fits. On big results, the heavier layouts step aside for faster ones so the canvas stays smooth.

schema-aware

Browse the catalog

See every vertex and edge with its labels, property types, and rough row counts. Click one and a ready-to-run MATCH snippet drops straight into the editor.

person1,204
movie318
acted_in2,902

portable

Take it with you

Save the canvas as PNG or JPG, or export results as GraphML, Cypher, JSON, or CSV — ready for a doc, a deck, or another tool.

PNGJPGGraphMLCypherJSONCSV

// querying

Ask in a line. Get a graph.

There's no new query language to learn and nothing to install in your database. If you can write a line of SQL, you already know enough to start exploring.

Graph mode does the busywork
Write a MATCH pattern and PGQViewer works out the rest — it pulls every key and property it needs and draws the matching nodes and edges.
SQL mode when you want control
Need more than a pattern? Run anything PostgreSQL understands — joins, recursive CTEs, EXPLAIN — and read the results in a sortable, filterable table.
Nothing hidden
The generated SQL is always one click away, long-running queries can be cancelled mid-flight, and rows stream onto the canvas as they arrive.
editor · socialgraph mode

you write this

(a IS person)-[k IS knows]->(b IS person)
PGQViewer runs this
generated SQL/PGQ
SELECT *
FROM GRAPH_TABLE ("public"."social"
  MATCH (a IS person)-[k IS knows]->(b IS person)
  COLUMNS (
    a.id   AS a__pk__id,   a.name  AS a__p__name,
    a.born AS a__p__born,  k.src   AS k__sk__src,
    k.dst  AS k__dk__dst,  k.since AS k__p__since,
    b.id   AS b__pk__id,   b.name  AS b__p__name,
    b.born AS b__p__born
  )
) LIMIT 500;

// quick start

Up and running in a minute.

PGQViewer is a small self-hosted web app — one Docker container runs both the UI and the API. Pull the published image, run a single command, and point it at any PostgreSQL 19 database. You bring the database; it brings the graphs.

Terminal
docker run --rm -p 127.0.0.1:8080:8080 -v pgqviewer-data:/data aondev/pgqviewer:latest
+ Prefer to build the image yourself?

The repo ships a Dockerfile, so you can build from a checkout instead of pulling — handy for contributors or pinning to a commit.

Terminal — build from source
git clone https://github.com/aoncodev/PGQViewer.git
cd PGQViewer
docker build -t pgqviewer .
docker run --rm -p 127.0.0.1:8080:8080 -v pgqviewer-data:/data pgqviewer
1

Connect

Point PGQViewer at your PostgreSQL 19 database and hit connect. Save it once, reconnect with a click.

2

Pick a graph

Choose a property graph from the sidebar — its labels and properties are right there, ready to explore.

3

Explore

Type a pattern, run it, and click around the canvas. Expand, drag, recolor, and export when you're done.

// open source

Open source, contributions welcome.

PGQViewer is Apache-2.0 and developed in the open. It's still early, so feedback genuinely helps — bug reports, fixes, and especially checks against new PostgreSQL 19 betas are all very welcome.

// get started

Start exploring your graphs.

It's free and open source. Pull the image, run one command, and point it at your PostgreSQL 19 — you'll be exploring in a minute. No desktop app to install, no sign-up.

Apache-2.0 · self-hosted with Docker · PostgreSQL 19 (Beta 1 or newer)