PG Studio

A fast, read-only PostgreSQL browser

Browse tables and views, filter and sort, follow foreign keys, read table structure and run read-only SQL in a clean web UI that runs on your machine. Every query is read-only.

Free and open source · Apache-2.0 license · PostgreSQL 14–17 · Node.js 20.6+

PG Studio demo: jump to a table with Cmd+K, build OR filters and preview their SQL, open a row in the side panel, read a function's source, switch to another database, dark mode

Everything you need to look at your data

And nothing that can change it. PG Studio does one job well: lets you explore a PostgreSQL database quickly and safely.

Read-only SQL editor

Ask a question in SQL: one read query at a time, with results, Explain analyze and export. Writes can't run.

Every server, every database

Saved connections and a database switcher in the top bar. Credentials never reach the browser.

Functions and procedures

Signatures, flags, full source and the triggers that call them. Shown, never run.

⌘K jump anywhere

Fuzzy search across every schema's tables, views and functions, recent ones first.

Filter panel

Stack conditions, match all or any, switch one off, and preview the exact SQL. All server-side.

Follow foreign keys

Jump to the referenced row, see the rows that point back, and use Back to return.

Row inspector

Full values with pretty-printed JSON, plus every field of the row in a side panel.

Structure tab

Sizes, stats, indexes and usage, constraints, triggers, and a generated CREATE script.

Fast deep paging

Keyset pagination: page 9,000 is as fast as page 1. 6 ms vs 1.2 s with OFFSET on 1M rows.

CSV and JSON export

Export the current view with its filters and sort, with formula-injection protection.

Shareable URLs

Connection, database, table, filters, sort, page and tab live in the URL. Bookmark any view.

Keyboard first, dark mode

Arrow keys, Enter, /, [ ] and ?. Follows your OS theme.

See it in action

Screenshots use the bundled demo database. All data is generated.

Filter panel with three conditions, match any, and the SQL preview
Filter panel with SQL preview
Row inspector showing pretty-printed JSONB and foreign-key links
Row inspector with JSONB and relationships
Structure tab with sizes, stats, columns and indexes
Structure tab
PG Studio in dark mode
Dark mode

Quick start

Try it in about 30 seconds with the bundled demo database (needs Node.js 20.6+ and Docker).

# clone and install
git clone https://github.com/sagaryeole/PG-Studio.git
cd PG-Studio
npm install

# start a throwaway PostgreSQL with ~430k rows of fake data
npm run demo:db

# open http://127.0.0.1:4321
npm run demo

Using your own database? Create a SELECT-only role, put its URL in .env and run npm run dev. Full instructions →

Safe to point at a real database

Every control is tested against hostile input. Read the security model →

  • No SQL built from requests. Identifiers are resolved from pg_catalog and quoted; every value is a bind parameter.
  • A fenced-in SQL editor. One read statement at a time, wrapped in a SELECT, on its own connection, never for superusers.
  • Read-only twice over. BEGIN READ ONLY with a mandatory rollback, plus a SELECT-only role.
  • Bounded reads. Row limits, cell size cuts, capped exports and a per-query statement_timeout.
  • Localhost hardening. Binds to 127.0.0.1, checks the Host header against DNS rebinding, and sends a strict CSP.
  • XSS-safe. Database values are always rendered as text.
  • No credential leaks. Connection strings are redacted from logs and errors.