Skip to content
pldbgapi

pldbgapi

pldebugger : server-side support for debugging PL/pgSQL functions

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3050
pldbgapi
pldebugger
1.10
LANG
Artistic
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sLd-r
No
Yes
Yes
Yes
yes
no
Relationships
See Also
plpgsql_check
plprofiler
plpgsql
pgtap
pg_stat_statements
plv8
plperl
plpython3u

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PGDG
1.10
18
17
16
15
14
pldebugger-
RPM
PGDG
1.9
18
17
16
15
14
pldebugger_$v-
DEB
PGDG
1.10
18
17
16
15
14
postgresql-$v-pldebugger-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PGDG 1.9
PGDG 1.8
PGDG 1.8
PGDG 1.8
PGDG 1.8
el8.aarch64
PGDG 1.9
PGDG 1.8
PGDG 1.8
PGDG 1.8
PGDG 1.8
el9.x86_64
PGDG 1.9
PGDG 1.8
PGDG 1.8
PGDG 1.8
PGDG 1.8
el9.aarch64
PGDG 1.9
PGDG 1.8
PGDG 1.8
PGDG 1.8
PGDG 1.8
el10.x86_64
PGDG 1.9
PGDG 1.8
PGDG 1.8
PGDG 1.8
PGDG 1.8
el10.aarch64
PGDG 1.9
PGDG 1.8
PGDG 1.8
PGDG 1.8
PGDG 1.8
d12.x86_64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
d12.aarch64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
d13.x86_64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
d13.aarch64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
u22.x86_64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
u22.aarch64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
u24.x86_64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
u24.aarch64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
u26.x86_64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
u26.aarch64
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PGDG 1.10
PackageVersionOSORGSIZEFile URL
pldebugger_181.9el8.x86_64pgdg38.7 KiBpldebugger_18-1.9-1PGDG.rhel8.x86_64.rpm
pldebugger_181.9el8.aarch64pgdg37.8 KiBpldebugger_18-1.9-1PGDG.rhel8.aarch64.rpm
pldebugger_181.9el9.x86_64pgdg36.9 KiBpldebugger_18-1.9-1PGDG.rhel9.x86_64.rpm
pldebugger_181.9el9.aarch64pgdg36.1 KiBpldebugger_18-1.9-1PGDG.rhel9.aarch64.rpm
pldebugger_181.9el10.x86_64pgdg37.2 KiBpldebugger_18-1.9-1PGDG.rhel10.x86_64.rpm
pldebugger_181.9el10.aarch64pgdg37.0 KiBpldebugger_18-1.9-1PGDG.rhel10.aarch64.rpm
postgresql-18-pldebugger1.10d12.x86_64pgdg71.6 KiBpostgresql-18-pldebugger_1.10-1.pgdg12+1_amd64.deb
postgresql-18-pldebugger1.9d12.x86_64pgdg71.4 KiBpostgresql-18-pldebugger_1.9-1.pgdg12+1_amd64.deb
postgresql-18-pldebugger1.10d12.aarch64pgdg70.1 KiBpostgresql-18-pldebugger_1.10-1.pgdg12+1_arm64.deb
postgresql-18-pldebugger1.9d12.aarch64pgdg70.0 KiBpostgresql-18-pldebugger_1.9-1.pgdg12+1_arm64.deb
postgresql-18-pldebugger1.10d13.x86_64pgdg72.0 KiBpostgresql-18-pldebugger_1.10-1.pgdg13+1_amd64.deb
postgresql-18-pldebugger1.9d13.x86_64pgdg71.8 KiBpostgresql-18-pldebugger_1.9-1.pgdg13+1_amd64.deb
postgresql-18-pldebugger1.10d13.aarch64pgdg70.5 KiBpostgresql-18-pldebugger_1.10-1.pgdg13+1_arm64.deb
postgresql-18-pldebugger1.9d13.aarch64pgdg70.4 KiBpostgresql-18-pldebugger_1.9-1.pgdg13+1_arm64.deb
postgresql-18-pldebugger1.10u22.x86_64pgdg72.4 KiBpostgresql-18-pldebugger_1.10-1.pgdg22.04+1_amd64.deb
postgresql-18-pldebugger1.9u22.x86_64pgdg72.4 KiBpostgresql-18-pldebugger_1.9-1.pgdg22.04+1_amd64.deb
postgresql-18-pldebugger1.10u22.aarch64pgdg71.1 KiBpostgresql-18-pldebugger_1.10-1.pgdg22.04+1_arm64.deb
postgresql-18-pldebugger1.9u22.aarch64pgdg71.1 KiBpostgresql-18-pldebugger_1.9-1.pgdg22.04+1_arm64.deb
postgresql-18-pldebugger1.10u24.x86_64pgdg70.7 KiBpostgresql-18-pldebugger_1.10-1.pgdg24.04+1_amd64.deb
postgresql-18-pldebugger1.9u24.x86_64pgdg70.5 KiBpostgresql-18-pldebugger_1.9-1.pgdg24.04+1_amd64.deb
postgresql-18-pldebugger1.10u24.aarch64pgdg68.9 KiBpostgresql-18-pldebugger_1.10-1.pgdg24.04+1_arm64.deb
postgresql-18-pldebugger1.9u24.aarch64pgdg68.7 KiBpostgresql-18-pldebugger_1.9-1.pgdg24.04+1_arm64.deb
postgresql-18-pldebugger1.10u26.x86_64pgdg70.1 KiBpostgresql-18-pldebugger_1.10-1.pgdg26.04+1_amd64.deb
postgresql-18-pldebugger1.9u26.x86_64pgdg70.3 KiBpostgresql-18-pldebugger_1.9-1.pgdg26.04+1_amd64.deb
postgresql-18-pldebugger1.10u26.aarch64pgdg68.7 KiBpostgresql-18-pldebugger_1.10-1.pgdg26.04+1_arm64.deb
postgresql-18-pldebugger1.9u26.aarch64pgdg68.7 KiBpostgresql-18-pldebugger_1.9-1.pgdg26.04+1_arm64.deb

Source

Install

Make sure PGDG repo available:

pig repo add pgdg -u    # add pgdg repo and update cache

Install this extension with pig:

pig install pldebugger;		# install via package name, for the active PG version
pig install pldbgapi;		# install by extension name, for the current active PG version

pig install pldbgapi -v 18;   # install for PG 18
pig install pldbgapi -v 17;   # install for PG 17
pig install pldbgapi -v 16;   # install for PG 16
pig install pldbgapi -v 15;   # install for PG 15
pig install pldbgapi -v 14;   # install for PG 14

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pldbgapi';

Create this extension with:

CREATE EXTENSION pldbgapi;

Usage

Sources: repo README, v1.10 release, extension control

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:

  1. Client GUI (pgAdmin) – displays source code, variables, and stack
  2. Target Backend – the session executing the PL/pgSQL code being debugged
  3. 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.

Caveats

  • The package name is pldebugger, while the extension created in SQL is pldbgapi; the catalog tracks package version 1.10 for PostgreSQL 14 through 18.
  • The v1.10 upstream release is a PostgreSQL compatibility update and does not document a new user-facing SQL API or debugging workflow.
  • Upstream troubleshooting says shared_preload_libraries = '$libdir/plugin_debugger' must be configured and PostgreSQL restarted. Missing or incorrect preload prevents global breakpoints and can also prevent pldbgapi SQL from loading on some platforms.
Last updated on