pldbgapi

pldbgapi

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

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3050
pldbgapi
pldebugger
1.9
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.9
18
17
16
15
14
pldebugger-
RPM
PGDG
1.9
18
17
16
15
14
pldebugger_$v-
DEB
PGDG
1.9
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.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
d12.aarch64
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
d13.x86_64
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
d13.aarch64
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
u22.x86_64
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
u22.aarch64
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
u24.x86_64
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
u24.aarch64
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PGDG 1.9
PackageVersionOSORGSIZEFile URL
pldebugger_161.8el8.x86_64pgdg38.5 KiBpldebugger_16-1.8-1PGDG.rhel8.x86_64.rpm
pldebugger_161.5el8.x86_64pgdg38.2 KiBpldebugger_16-1.5-3PGDG.rhel8.x86_64.rpm
pldebugger_161.8el8.aarch64pgdg37.5 KiBpldebugger_16-1.8-1PGDG.rhel8.aarch64.rpm
pldebugger_161.5el8.aarch64pgdg37.2 KiBpldebugger_16-1.5-3PGDG.rhel8.aarch64.rpm
pldebugger_161.8el9.x86_64pgdg37.1 KiBpldebugger_16-1.8-1PGDG.rhel9.x86_64.rpm
pldebugger_161.5el9.x86_64pgdg36.9 KiBpldebugger_16-1.5-3PGDG.rhel9.x86_64.rpm
pldebugger_161.8el9.aarch64pgdg36.3 KiBpldebugger_16-1.8-1PGDG.rhel9.aarch64.rpm
pldebugger_161.5el9.aarch64pgdg35.9 KiBpldebugger_16-1.5-3PGDG.rhel9.aarch64.rpm
pldebugger_161.8el10.x86_64pgdg37.2 KiBpldebugger_16-1.8-3PGDG.rhel10.x86_64.rpm
pldebugger_161.8el10.aarch64pgdg36.9 KiBpldebugger_16-1.8-3PGDG.rhel10.aarch64.rpm
postgresql-16-pldebugger1.9d12.x86_64pgdg71.3 KiBpostgresql-16-pldebugger_1.9-1.pgdg12+1_amd64.deb
postgresql-16-pldebugger1.9d12.aarch64pgdg69.9 KiBpostgresql-16-pldebugger_1.9-1.pgdg12+1_arm64.deb
postgresql-16-pldebugger1.9d13.x86_64pgdg71.8 KiBpostgresql-16-pldebugger_1.9-1.pgdg13+1_amd64.deb
postgresql-16-pldebugger1.9d13.aarch64pgdg70.3 KiBpostgresql-16-pldebugger_1.9-1.pgdg13+1_arm64.deb
postgresql-16-pldebugger1.9u22.x86_64pgdg82.4 KiBpostgresql-16-pldebugger_1.9-1.pgdg22.04+1_amd64.deb
postgresql-16-pldebugger1.9u22.aarch64pgdg81.0 KiBpostgresql-16-pldebugger_1.9-1.pgdg22.04+1_arm64.deb
postgresql-16-pldebugger1.9u24.x86_64pgdg70.5 KiBpostgresql-16-pldebugger_1.9-1.pgdg24.04+1_amd64.deb
postgresql-16-pldebugger1.9u24.aarch64pgdg68.6 KiBpostgresql-16-pldebugger_1.9-1.pgdg24.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
pldebugger_151.8el8.x86_64pgdg39.1 KiBpldebugger_15-1.8-1PGDG.rhel8.x86_64.rpm
pldebugger_151.5el8.x86_64pgdg96.8 KiBpldebugger_15-1.5-1.rhel8.x86_64.rpm
pldebugger_151.8el8.aarch64pgdg38.0 KiBpldebugger_15-1.8-1PGDG.rhel8.aarch64.rpm
pldebugger_151.5el8.aarch64pgdg95.1 KiBpldebugger_15-1.5-1.rhel8.aarch64.rpm
pldebugger_151.8el9.x86_64pgdg39.2 KiBpldebugger_15-1.8-1PGDG.rhel9.x86_64.rpm
pldebugger_151.5el9.x86_64pgdg98.5 KiBpldebugger_15-1.5-1.rhel9.x86_64.rpm
pldebugger_151.8el9.aarch64pgdg38.5 KiBpldebugger_15-1.8-1PGDG.rhel9.aarch64.rpm
pldebugger_151.5el9.aarch64pgdg97.3 KiBpldebugger_15-1.5-1.rhel9.aarch64.rpm
pldebugger_151.8el10.x86_64pgdg39.2 KiBpldebugger_15-1.8-3PGDG.rhel10.x86_64.rpm
pldebugger_151.8el10.aarch64pgdg39.2 KiBpldebugger_15-1.8-3PGDG.rhel10.aarch64.rpm
postgresql-15-pldebugger1.9d12.x86_64pgdg71.8 KiBpostgresql-15-pldebugger_1.9-1.pgdg12+1_amd64.deb
postgresql-15-pldebugger1.9d12.aarch64pgdg70.4 KiBpostgresql-15-pldebugger_1.9-1.pgdg12+1_arm64.deb
postgresql-15-pldebugger1.9d13.x86_64pgdg72.3 KiBpostgresql-15-pldebugger_1.9-1.pgdg13+1_amd64.deb
postgresql-15-pldebugger1.9d13.aarch64pgdg71.2 KiBpostgresql-15-pldebugger_1.9-1.pgdg13+1_arm64.deb
postgresql-15-pldebugger1.9u22.x86_64pgdg83.9 KiBpostgresql-15-pldebugger_1.9-1.pgdg22.04+1_amd64.deb
postgresql-15-pldebugger1.9u22.aarch64pgdg82.4 KiBpostgresql-15-pldebugger_1.9-1.pgdg22.04+1_arm64.deb
postgresql-15-pldebugger1.9u24.x86_64pgdg71.8 KiBpostgresql-15-pldebugger_1.9-1.pgdg24.04+1_amd64.deb
postgresql-15-pldebugger1.9u24.aarch64pgdg70.2 KiBpostgresql-15-pldebugger_1.9-1.pgdg24.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
pldebugger_141.8el8.x86_64pgdg39.1 KiBpldebugger_14-1.8-1PGDG.rhel8.x86_64.rpm
pldebugger_141.5el8.x86_64pgdg95.2 KiBpldebugger_14-1.5-1.rhel8.x86_64.rpm
pldebugger_141.4el8.x86_64pgdg95.0 KiBpldebugger_14-1.4-1.rhel8.x86_64.rpm
pldebugger_141.8el8.aarch64pgdg37.9 KiBpldebugger_14-1.8-1PGDG.rhel8.aarch64.rpm
pldebugger_141.5el8.aarch64pgdg93.6 KiBpldebugger_14-1.5-1.rhel8.aarch64.rpm
pldebugger_141.8el9.x86_64pgdg39.1 KiBpldebugger_14-1.8-1PGDG.rhel9.x86_64.rpm
pldebugger_141.5el9.x86_64pgdg96.8 KiBpldebugger_14-1.5-1.rhel9.x86_64.rpm
pldebugger_141.8el9.aarch64pgdg38.4 KiBpldebugger_14-1.8-1PGDG.rhel9.aarch64.rpm
pldebugger_141.5el9.aarch64pgdg95.8 KiBpldebugger_14-1.5-1.rhel9.aarch64.rpm
pldebugger_141.8el10.x86_64pgdg39.2 KiBpldebugger_14-1.8-3PGDG.rhel10.x86_64.rpm
pldebugger_141.8el10.aarch64pgdg39.1 KiBpldebugger_14-1.8-3PGDG.rhel10.aarch64.rpm
postgresql-14-pldebugger1.9d12.x86_64pgdg71.6 KiBpostgresql-14-pldebugger_1.9-1.pgdg12+1_amd64.deb
postgresql-14-pldebugger1.9d12.aarch64pgdg70.1 KiBpostgresql-14-pldebugger_1.9-1.pgdg12+1_arm64.deb
postgresql-14-pldebugger1.9d13.x86_64pgdg71.9 KiBpostgresql-14-pldebugger_1.9-1.pgdg13+1_amd64.deb
postgresql-14-pldebugger1.9d13.aarch64pgdg70.7 KiBpostgresql-14-pldebugger_1.9-1.pgdg13+1_arm64.deb
postgresql-14-pldebugger1.9u22.x86_64pgdg82.3 KiBpostgresql-14-pldebugger_1.9-1.pgdg22.04+1_amd64.deb
postgresql-14-pldebugger1.9u22.aarch64pgdg81.0 KiBpostgresql-14-pldebugger_1.9-1.pgdg22.04+1_arm64.deb
postgresql-14-pldebugger1.9u24.x86_64pgdg71.6 KiBpostgresql-14-pldebugger_1.9-1.pgdg24.04+1_amd64.deb
postgresql-14-pldebugger1.9u24.aarch64pgdg70.1 KiBpostgresql-14-pldebugger_1.9-1.pgdg24.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

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:

  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.

Last updated on