VS Code extension

PostgreSQL development, directly in VS Code.

PostgreSQL Workbench is a PostgreSQL development extension for VS Code. Explore schemas, write and run SQL, inspect and edit data, execute pgTAP tests with coverage, and debug PL/pgSQL without leaving the editor.

PostgreSQL Cockpit exploring the relationships around a database table

Features

The PostgreSQL development loop in VS Code.

01

Understand schema relationships.

Select a table, view, routine, or trigger to explore its upstream and downstream relationships. Pin important objects and save perspectives for later.

Cockpit guide
PostgreSQL Cockpit architecture graph and source inspector

02

Run SQL in persistent scratchpads.

Each scratchpad stays connected to the database you selected. Run multiple statements, page and sort results, inspect structured values, and export result sets.

Scratchpad guide
SQL notebook running a query and displaying a PostgreSQL result grid

03

Inspect and edit PostgreSQL data.

Open a table, view, or SQL statement in a Data View. Compose joins, filter and sort rows, and export the result. When the query identifies editable rows, stage changes and apply them in one transaction.

Data View guide
PostgreSQL Data View composing a query with a related table and filtering its rows

04

Run pgTAP tests with coverage.

Discover tests in the native VS Code Test Explorer, run selected suites, and inspect PL/pgSQL statement and branch coverage directly in the editor.

Testing and coverage guide
pgTAP tests running with PL/pgSQL coverage in VS Code

05

Debug PL/pgSQL.

Set breakpoints, step across nested calls, inspect records, arrays, and JSON, change variables, and evaluate SQL from the Debug Console.

Debugger guide
PL/pgSQL debug session with variables and source code in VS Code

Getting started

Connect your development database.

Use an existing PostgreSQL server, or start a disposable Docker database with the PL/pgSQL debugger already configured.

  1. 1

    Install the extension

    Get PostgreSQL Workbench from the Visual Studio Marketplace.

  2. 2

    Add a connection

    Open PostgreSQL Workbench and add your Connection. For a disposable local server, run PostgreSQL Workbench: Start Local Debug Database (Docker).

  3. 3

    Index the database

    Open Sources to build the schema index, then explore relationships, run SQL, test routines, or start debugging.

Manual Docker alternative
docker run -d --name pg-debug \
  -p 127.0.0.1:5432:5432 \
  -e POSTGRES_PASSWORD=postgres \
  galien0xffffff/postgres-debugger:17

Disposable local credentials: database, user, and password are postgres.

Documentation

Guides and reference.

Follow a workflow guide or browse the generated reference for every command and setting.

Visual Studio Marketplace

Install PostgreSQL Workbench for VS Code.