pgview try it

Try pgview

v0.6.0 ~2 min setup no cloud account needed

This guide walks you through spinning up a local PostgreSQL instance with realistic seed data and exploring every feature of pgview hands-on. Everything runs locally — no cloud account, no installer, no runtime dependencies beyond a container engine you likely already have.

The demo kit lives in the pgview repo at demo/. It contains a docker-compose.yml, a seed.sql, and a Makefile that wire everything together.

Quick Start

Two commands. The only hard requirement is a container runtime (Docker Desktop, Colima, or Podman) — curl and bash are both pre-installed on macOS and most Linux distros. The script auto-detects your OS and architecture, starts a seeded PostgreSQL container on port 5433, downloads the correct pgview binary, and launches it.

macOS / Linux
Windows
# Download the start script (curl or wget — one will be available)
curl -fsSL https://raw.githubusercontent.com/sibasismukherjee/pgview/main/demo/start.sh -o start.sh

# Run it — fetches docker-compose.yml, seed.sql, and the pgview binary automatically
bash start.sh

When you are done:

docker compose down && rm pgview start.sh docker-compose.yml seed.sql
pgview has no native Windows binary. You need WSL2 with a Linux distribution installed (Ubuntu is recommended). Docker Desktop for Windows with WSL2 integration enabled works without any extra steps.

Inside your WSL2 terminal, run the same two commands as macOS/Linux:

curl -fsSL https://raw.githubusercontent.com/sibasismukherjee/pgview/main/demo/start.sh -o start.sh
bash start.sh

Docker Desktop's WSL2 integration means the docker command inside WSL2 talks directly to the Windows Docker daemon — no extra configuration needed.

What the script does

StepAction
1Downloads docker-compose.yml and seed.sql if not already present
2Detects Docker, Podman, or Colima; starts Colima automatically if installed but not running
3Runs docker compose up -d — postgres starts and seed data loads on first boot
4Polls until postgres is healthy
5Downloads the correct pgview binary for your OS and CPU architecture
6Strips the macOS Gatekeeper quarantine bit automatically (no manual step needed)
7Launches pgview connected to the demo database
Prefer make? A Makefile is also included in the demo/ directory. make try calls start.sh; make stop and make clean tear down the container and binary.

Manual Setup

Prefer to control each step yourself, or already have a container running? Expand the relevant tab below.

Container runtime

Docker Desktop
Colima (macOS)
Podman
# macOS
brew install --cask docker   # then open Docker Desktop once

# Linux
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER   # log out and back in
brew install colima docker
colima start   # start a lightweight Lima VM; docker CLI works as normal
# macOS
brew install podman && podman machine init && podman machine start

# Linux (Debian/Ubuntu)
sudo apt-get install -y podman

alias docker=podman   # all docker commands work identically

Start PostgreSQL & seed

# Using docker-compose (recommended)
docker compose up -d
# seed.sql is loaded automatically on first boot via /docker-entrypoint-initdb.d/

# Or run a bare container and seed manually
docker run -d --name pgview-demo \
  -e POSTGRES_PASSWORD=demo -e POSTGRES_DB=demodb \
  -p 5433:5432 postgres:16-alpine

# Wait until ready
until docker exec pgview-demo pg_isready -U postgres -d demodb -q; do sleep 1; done

# Apply seed
curl -fsSL https://raw.githubusercontent.com/sibasismukherjee/pgview/main/demo/seed.sql \
  | docker exec -i pgview-demo psql -U postgres -d demodb

Download pgview

macOS arm64
macOS Intel
Linux amd64
TAG=$(curl -sfL "https://api.github.com/repos/sibasismukherjee/pgview/releases/latest" | grep '"tag_name"' | cut -d'"' -f4)
curl -sfL "https://github.com/sibasismukherjee/pgview/releases/download/${TAG}/pgview_${TAG}_darwin_arm64" -o pgview
chmod +x pgview && sudo mv pgview /usr/local/bin/
TAG=$(curl -sfL "https://api.github.com/repos/sibasismukherjee/pgview/releases/latest" | grep '"tag_name"' | cut -d'"' -f4)
curl -sfL "https://github.com/sibasismukherjee/pgview/releases/download/${TAG}/pgview_${TAG}_darwin_amd64" -o pgview
chmod +x pgview && sudo mv pgview /usr/local/bin/
TAG=$(curl -sfL "https://api.github.com/repos/sibasismukherjee/pgview/releases/latest" | grep '"tag_name"' | cut -d'"' -f4)
curl -sfL "https://github.com/sibasismukherjee/pgview/releases/download/${TAG}/pgview_${TAG}_linux_amd64" -o pgview
chmod +x pgview && sudo mv pgview /usr/local/bin/

Connect to PostgreSQL

Run pgview and point it at the container you started earlier:

# One-liner (if you used make try, this is already running)
pgview -url localhost:5433 -username postgres -password demo -dbname demodb -sslmode disable

Or run interactively and enter each value at the prompt:

pgview
# Connection URL (host:port): localhost:5433
# Username: postgres
# Database [postgres]: demodb
# Password: demo  ← not echoed

pgview opens directly on the Table List. You'll see tables across two schemas: demo.* (customers, orders, products, order_items — used in this walkthrough) and public.* (routes, orders — used in the demo GIF).

The top-left corner always shows postgres@demodb · localhost — a quick reminder of which database you are connected to.

Feature 1 — Table List

The table list is the home screen. Use / to move the selection. Try these keys:

i — Table stats. Hover over demo.orders and press i. The top-right panel shows the estimated row count, primary key column(s), and index count — fetched from pg_class without scanning the table.
Enter — Open data view. Press Enter on any table to browse its rows. Press Esc to return here.
d — Schema browser. Press d on demo.orders to open the 4-tab schema panel. Covered in detail in the Schema Browser section.
e — SQL editor. Opens a full-screen SQL editor pre-filled with nothing (from the table list) or with the last query (from the data view).
q — Quit. Exits pgview cleanly.

Feature 2 — Fuzzy Table Search

From the table list, press / to open the full-screen fuzzy finder. It searches all schemas simultaneously.

Type ord — pgview instantly filters to demo.orders and demo.order_items. Matched characters are highlighted in blue.
Type cu — narrows to demo.customers. Press Enter to jump straight into its data view.
Press Esc to return to the table list with no change.
Fuzzy scoring rewards consecutive matches and word-boundary hits — so oi ranks order_items above orders.

Feature 3 — Data View & Filter DSL

Navigate to demo.orders (fuzzy search ord then Enter). The data view shows 200 rows per page with type-aware colouring: numeric values are green, timestamps orange, NULL is dim gray, booleans are teal/red.

/ — Filter prompt. Try these filters one at a time. Press Esc between each to clear:
status=paid               # exact match
status!=cancelled         # negation
total>100                 # numeric comparison
total>=50 status=shipped  # AND — two terms
Array filter on customers. Navigate to demo.customers and try:
tags=vip          # element-wise: ANY(tags) = 'vip'
tags=%newsletter% # substring per element
JSONB filter on orders. Navigate back to demo.orders and try:
notes=%web%      # matches rows where notes contains "web"
g / G — Jump to the top or bottom of the result set. n / p — Next / previous page (200 rows per page).
Scroll left / right. On a wide result set (try demo.order_items), swipe horizontally with two fingers or use WheelLeft / WheelRight to pan columns.

Feature 4 — Schema Browser

From the table list or data view, press d to open the 4-tab schema panel. Try it on demo.orders, which has a FK, a CHECK constraint, two indexes, and a rich DDL.

1 — Columns tab. Shows column name, type (accurate via pg_catalog.format_type), nullability, and default. Notice total is numeric(10,2) and notes is jsonb.
2 — Indexes tab. You'll see orders_pkey (PRIMARY, btree), idx_orders_customer, and idx_orders_status with their full pg_get_indexdef definitions.
3 — Constraints tab. Shows orders_pkey (PRIMARY KEY), the FK to customers, and the orders_status_chk CHECK constraint with its expression.
4 — DDL tab. A reconstructed CREATE TABLE statement — copy-pasteable into psql or a migration file. Scroll down to see the standalone CREATE INDEX lines.
Tab / Shift+Tab — cycle through tabs without using the number keys. Esc returns to the table list.

Feature 5 — Row Viewer & Inline Editor

Navigate into demo.customers, select any row, and press f.

Row Viewer — every column with its current value in a two-column bordered table. Type-aware colouring matches the data view (array values, NULL, etc.).
Press e or Enter on the status field. The input bar at the bottom pre-fills with the current value (active). Change it to inactive and press Enter. The field is now highlighted in teal with an (edited) marker.
Press Ctrl+S to commit. pgview runs:
UPDATE demo.customers SET status = 'inactive' WHERE id = <original_id>
The data view refreshes and the change is visible immediately.
Type NULL in the input bar to set a field to SQL NULL (any case works). Useful for clearing the tags array.
Press Esc to close without saving.
Editing the primary-key column is safe — pgview captures the original PK value at open time and uses it in the WHERE clause, so the right row is always targeted.

Feature 6 — SQL Editor & Templates

Press e from any view to open the full-screen SQL editor. From the data view the editor is pre-filled with the last query.

Write and run a query. Type:
SELECT c.name, COUNT(o.id) AS order_count, SUM(o.total) AS total_spent
FROM demo.customers c
LEFT JOIN demo.orders o ON o.customer_id = c.id
GROUP BY c.name
ORDER BY total_spent DESC NULLS LAST;
Press Ctrl+E to run. Results appear in the data view.
Tab — schema-aware completion. Type SELECT * FROM demo. and press Tab. pgview suggests table names. After selecting one, type a column name prefix and press Tab again for column suggestions in context.
Ctrl+T — templates panel. Open the editor from demo.orders data view, then press Ctrl+T. The left panel fills with pre-built queries using the real column names of orders. Select INSERT and press Enter — a complete INSERT template with all columns drops into the editor.
Ctrl+R — query history. Shows the last 50 queries most-recent-first. Press Enter to reload any entry. Esc closes the panel.
Ctrl+L — clear the editor. Esc — cancel and return to the previous view.

Feature 7 — Export to CSV / JSON

From any data view (table browse or SQL results), press E (Shift+E) to start the interactive export flow.

Step 1: choose format. At the export format: prompt type csv and press Enter.
Step 2: confirm path. The path is pre-filled as ~/export_orders_<timestamp>.csv. Press Enter to accept, or edit it first.
All rows are exported — not just the visible page. pgview re-runs the current query without LIMIT / OFFSET. With the status=paid filter active, only paid orders are written.
Open the file to verify:
head -5 ~/export_orders_*.csv
You'll see the header row followed by data rows; NULL fields are empty strings.
Try again with json format. NULL becomes null in the JSON output.

Feedback & Roadmap

Thank you for trying pgview! Your feedback shapes what gets built next.

Report an Issue

Found a bug, unexpected behaviour, or something that felt off? Open an issue on GitHub — include your OS, the binary you used, and steps to reproduce.

Open an Issue →

See the Roadmap

Curious what's coming next? The project board tracks every planned enhancement — EXPLAIN panel, clipboard copy, connection manager, inline cell editing, and more.

View Roadmap →

Feature requests are also welcome as GitHub Issues — browse the open issues first to see if your idea already has a thread, or open a new one with the enhancement label.

Clean up

When you are done, tear down the demo container and remove the binary:

make stop && make clean

# Or manually
docker compose down