The two-minute sample
PGQViewer doesn't ship a demo database — you bring your own. If you don't have a property graph yet, this gets you from nothing to an interactive canvas in about two minutes.
1 · Spin up PostgreSQL 19
Any PG19 instance (Beta 1 or newer) works. The official image is the fastest path:
docker run 5432:5432 POSTGRES_PASSWORD=postgres postgres:19beta12 · Create the graph
Connect with psql (user postgres, password postgres) and run:
CREATE TABLE people (
id int PRIMARY KEY,
name text NOT NULL,
born int
);
CREATE TABLE knows (
src int NOT NULL REFERENCES people (id),
dst int NOT NULL REFERENCES people (id),
since int,
PRIMARY KEY (src, dst)
);
INSERT INTO people VALUES (1,'Alice',1985), (2,'Bob',1990), (3,'Carol',1988), (4,'Dave',1992);
INSERT INTO knows VALUES (1,2,2010), (2,3,2012), (3,4,2015), (1,4,2020);
CREATE PROPERTY GRAPH social
VERTEX TABLES (
people LABEL person PROPERTIES ALL COLUMNS
)
EDGE TABLES (
knows
SOURCE KEY (src) REFERENCES people (id)
DESTINATION KEY (dst) REFERENCES people (id)
LABEL knows PROPERTIES ALL COLUMNS
);Two ordinary tables, four people, four knows edges — and one CREATE PROPERTY GRAPH statement that declares how they form a graph. Note PROPERTIES ALL COLUMNS: it exposes the key columns as properties, which PGQViewer needs to reconstruct row identity (see Limitations).
3 · Draw it
- Open PGQViewer at
http://localhost:8080and connect. If PostgreSQL runs on the same machine as the PGQViewer container, use hosthost.docker.internal. - Pick
public.socialin the sidebar — it auto-selects if it's the only graph. - Paste the pattern and press ⌘/Ctrl + Enter:
(a IS person)-[k IS knows]->(b IS person)Four teal person nodes appear, connected by directed knows edges. Click Alice to see her properties in the footer; double-click any node to expand its 1-hop neighbourhood; drag nodes to rearrange them; switch the layout dropdown to dagre to see the hierarchy.
Where to go next
- Querying — MATCH patterns, WHERE clauses inside element fillers, and SQL mode for everything else.
- The canvas — layouts, theming, exports.