The quick summary
- Free. MIT license. No account, no subscription, no usage limits.
- Native VS Code. Not a webview wrapper — actual VS Code panels, sidebar, notebooks, CodeLens, status bar.
- SQL notebooks with inline results, charts, cell editing, and export.
- AI assistant with your choice of provider, schema context, and notebook-first execution.
- Production safety built in: environment tags, read-only mode, query risk scoring, auto-LIMIT.
- Live monitoring dashboard with active query management.
- Full CRUD on tables, views, functions, types, roles, extensions, FDWs.
- EXPLAIN CodeLens, Index Advisor, Visual Table Designer, Schema Diff.
PgStudio
If you work with PostgreSQL and write code in VS Code, you have probably developed a rhythm that involves two windows. One for your editor. One for your database tool — pgAdmin, TablePlus, DBeaver, or whatever you landed on. You Alt-Tab between them constantly. You keep a mental map of which schema is open where. You copy query results out to Excel when someone asks for a chart. You paste error messages from one window into the other to figure out what went wrong.
PgStudio is built to collapse that into one.
It is a VS Code extension — free, MIT-licensed, installs in one click — that brings a full PostgreSQL management environment directly into your editor. Not a simplified plugin. A proper IDE: tree-based database explorer, interactive SQL notebooks, real-time monitoring dashboard, AI assistant, visual table designer, and production safety controls, all as native VS Code panels.
What you get immediately after installing
A database explorer in your sidebar.
Connect to any PostgreSQL server and browse everything: tables, views, materialized views, functions, types, roles, extensions, and foreign data wrappers, organized in a hierarchical tree under each connection. Right-click any object to script it, VACUUM it, view its definition, or open it in a notebook.
SQL notebooks with .pgsql files.
This is the core workflow. Instead of a query editor that shows one result at a time, notebooks let you build up a sequence of cells — markdown for notes, SQL for queries — and run them individually or all at once. Results render inline with full table output, column resizing, inline cell editing, and one-click export to CSV, JSON, or Excel. If your result set looks like it wants to be a chart, one click gives you bar, line, pie, area, or scatter — without leaving the notebook.
A live monitoring dashboard.
Active connections, database size, cache hit ratio, running queries, lock chains, index health, autovacuum progress — all updating in real time inside VS Code. You can kill or cancel a running query directly from the dashboard. No separate monitoring tab to open.
An AI assistant that knows your schema.
Ask it to write a query in natural language, explain a complex one, suggest an index, or fix a syntax error. It supports GitHub Copilot, GitHub Models, OpenAI, Anthropic, Gemini, and local models via Ollama or LM Studio — you pick what you already have. Critically: it never executes anything automatically. Every suggestion lands in a notebook cell, where you review it and decide whether to run it. The AI assists; you execute.
Things that are less obvious but matter
EXPLAIN CodeLens.
Every SQL cell in a notebook gets an EXPLAIN and EXPLAIN ANALYZE button above it, rendered as VS Code CodeLens actions. One click inserts the execution plan as a new cell below your query. You can see the plan and the query together in the same notebook, which makes iterative optimization significantly less tedious.
Saved queries with connection context.
When you save a query, it remembers not just the SQL but which connection, database, and schema it belongs to. Reopening it restores the full context in a new notebook automatically. Tags let you group queries by purpose. The AI can generate a title and description for you.
Inline cell editing.
Double-click any cell in a query result to edit it. Changes generate parameterized UPDATE statements inside a transaction, with ROLLBACK on failure. Composite primary keys and NULL values are handled correctly.
Index Advisor and Schema Diff.
These are the kinds of features that normally live in paid tools. PgStudio surfaces index recommendations based on your query patterns and lets you compare schemas across connections, with generated patch SQL you can review before applying.
Visual Table Designer.
Create or alter tables without writing DDL. Define columns, data types, constraints, and foreign keys through a GUI, with a live SQL preview so you always know exactly what will run.
Foreign Data Wrappers.
Full management UI for creating foreign servers, user mappings, and foreign tables. Not just documentation — you can create and drop FDW objects directly from the tree view.
Who it is for
- If you are a backend developer who writes application code and occasionally needs to inspect or query your database, PgStudio removes the tool-switching overhead entirely. Your database is just another panel in the editor you already have open.
- If you are a data analyst who writes SQL regularly, the notebook workflow — cells, inline results, charts, export — gives you a proper workspace instead of a single query box. The AI assistant is useful for translating business questions into SQL when the schema is complex.
- If you are a DBA or platform engineer managing multiple environments, the connection safety features (environment tagging, read-only mode, risk scoring) and the monitoring dashboard give you a practical daily-use tool, not just a query runner.
How to install
code --install-extension ric-v.postgres-explorer
Or: Extensions panel → search PostgreSQL Explorer → Install.
After installing, the PostgreSQL elephant icon appears in the Activity Bar. Click it, add a connection, and you are in.
Links
Install: VS Code Marketplace · Open VSX
Docs & demo: pgstudio.astrx.dev
Source: Github | PgStudio




Top comments (0)