Debug PL/pg SQL with Intellij Database Tools
- Debug queries from editor
- Debug routines and triggers from database explorer
- Full support for variables inspection with Docker custom debugger
Submit features => Production ready task list
Report a bug or a problem => Create an issue
Try out the Docker image with the ready to use enhanced debugger (versions 11 to 14).
docker run -p 5514:5432 --name PG14-debug -e POSTGRES_PASSWORD=postgres -d galien0xffffff/postgres-debugger:14
Run this script on your database
CREATE EXTENSION if not exists pldbgapi;
To build your own image instructions are here
Just write a statement using the function you want to debug
SELECT function_name(args)
Choose Debug routine action in the database tree and run it in a console
(Composite types are not returned by the extension see Limitation)
- Basic variables
- Arrays(including array of composite)
Arguments and variables are displayed in code, it can be disabled in the plugin configuration.
The debugger activity is visible as a background process in the IDE
The standard pldbgapi does not send back composite variable, but you can put it in arrays to inspect them.
A modified extension is available in this repo, hope this can be integrated in the official extension soon.
At the moment indirect debugging is not supported but will be available soon.
You must first install the debugger extension and activate the shared library onto the server.
Follow these instructions for PgAdmin
-
Using IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "idea-plpgdebugger" > Install Plugin
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Plugin based on the IntelliJ Platform Plugin Template.