VS Code extension

Explore schemas, run SQL, test routines, and debug PL/pgSQL.

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.

SQL notebook running a query and displaying a PostgreSQL result grid

03

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.

pgTAP tests running with PL/pgSQL coverage in VS Code

04

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 server. For a disposable local server, run PL/pgSQL: 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.