All Products
Search
Document Center

PolarDB:Use the pldebugger plugin

Last Updated:Mar 30, 2026

PolarDB for PostgreSQL (Compatible with Oracle) supports multiple stored procedure languages (SPLs) — PL/pgSQL, PL/Python, PL/Perl, PL/Tcl, and PL/Java. The pldebugger extension lets you interactively debug functions and stored procedures written in these languages through pgAdmin 4.

Prerequisites

Before you begin, make sure you have:

  • pgAdmin 4 v4.19 or later. Download it from pgAdmin.org.

  • A polar_superuser account. This permission is required to run CREATE EXTENSION.

Connection limits

Each PolarDB cluster supports up to three simultaneous pldebugger connections. Each debugging session uses two connections, so a maximum of three debugging sessions can run at the same time.

To increase the limit beyond three connections, go to Quota Center and click Apply in the Actions column for PolarDB PG pldebugger plug-in use.

If you reach the connection limit, close an existing session before starting a new one.

Enable the pldebugger extension

Log in as polar_superuser and run:

postgres=# CREATE EXTENSION if not exists pldbgapi;
CREATE EXTENSION

Debug a function

  1. Open pgAdmin 4 and connect to your PolarDB cluster.

  2. In the object browser, find the function to debug, right-click it, and choose Debugging > Debug.

    Use pldebugger - 1

  3. Use the pldebugger extension in pgAdmin 4.

    • In the function debugging section on the right panel, you can perform step-by-step operations such as step into/over, continue, set breakpoints, and stop.

    • At the bottom panel, you can view local variables, debugging results, and function stacks during the debugging session.

    Use pldebugger - 2

Monitor connections to pldebugger

To see how many connections are currently in use, run:

postgres=# select * from polar_monitor_pldebugger_count();
 current_connection | max_connection
--------------------+----------------
                  6 |              6
(1 row)

Column

Description

current_connection

The number of connections currently in use.

max_connection

The maximum number of allowed connections.

In the example above, 6 connections are in use. Because each debugging session requires 2 connections, 3 debugging sessions are active — the maximum allowed.

What's next