pldbgapi
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pldebugger | 1.9 | LANG | Artistic | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3050 | pldbgapi | No | Yes | No | Yes | No | Yes | - |
| Related | plpgsql_check plprofiler plpgsql pgtap pg_stat_statements plv8 plperl plpython3u |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 1.9 | 1817161514 | pldebugger | - |
| RPM | PGDG | 1.9 | 1817161514 | pldebugger_$v | - |
| DEB | PGDG | 1.9 | 1817161514 | postgresql-$v-pldebugger | - |
Install
You can install pldebugger directly. First, make sure the PGDG repository is added and enabled:
pig repo add pgdg -u # Add PGDG repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pldebugger; # Install for current active PG version
pig ext install -y pldebugger -v 18 # PG 18
pig ext install -y pldebugger -v 17 # PG 17
pig ext install -y pldebugger -v 16 # PG 16
pig ext install -y pldebugger -v 15 # PG 15
pig ext install -y pldebugger -v 14 # PG 14
dnf install -y pldebugger_18 # PG 18
dnf install -y pldebugger_17 # PG 17
dnf install -y pldebugger_16 # PG 16
dnf install -y pldebugger_15 # PG 15
dnf install -y pldebugger_14 # PG 14
apt install -y postgresql-18-pldebugger # PG 18
apt install -y postgresql-17-pldebugger # PG 17
apt install -y postgresql-16-pldebugger # PG 16
apt install -y postgresql-15-pldebugger # PG 15
apt install -y postgresql-14-pldebugger # PG 14
Create Extension:
CREATE EXTENSION pldbgapi;
Usage
pldbgapi: server-side support for debugging PL/pgSQL functions
pldbgapi provides a server-side API for interactive debugging of PL/pgSQL functions. It is typically used through a GUI client such as pgAdmin.
CREATE EXTENSION pldbgapi;
Debugging with pgAdmin
The primary way to use the debugger is through pgAdmin’s graphical interface:
- Direct Debugging: Right-click a function and select “Debug” to execute and step through it immediately
- Global Breakpoints: Select “Set Global Breakpoint” on a function, then wait for another session (e.g., a web application) to call that function – the debugger will intercept the call and allow in-context debugging
Debugging Capabilities
When connected through a debug client, you can:
- Set breakpoints on specific lines in PL/pgSQL functions
- Step through code line by line (step into, step over, step out)
- Inspect variables and their current values at each step
- View the call stack for nested function calls
- Continue execution to the next breakpoint
Architecture
The debugging system has three components:
- Client GUI (pgAdmin) – displays source code, variables, and stack
- Target Backend – the session executing the PL/pgSQL code being debugged
- Debugging Proxy – coordinates between the client and target via a dedicated connection
Supported Languages
The debugger works with PL/pgSQL functions and procedures. It requires the pldbgapi extension to be created in each database where debugging is needed.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.