Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature Request]: Integrate PL/pgSQL Debugger (pldebugger) with GUI similar to pgAdmin/DBeaver

Aperta
#243 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
postgresql, vscode

Direzione di ricerca

Inizia esaminando il workflow esistente di vscode-pgsql e i prerequisiti di pldebugger descritti nell’issue: installazione del server, shared_preload_libraries, rilevamento dei riavvii e creazione di pldbgapi. Definisci l’ambito dell’implementazione prima di iniziare a scrivere codice, poiché la richiesta comprende sia l’automazione della configurazione sia un’interfaccia completa per il debugger di VS Code. Il completamento deve includere la gestione verificata dei prerequisiti e le funzionalità per breakpoint, esecuzione passo-passo, variabili, stack delle chiamate, parametri, output e watch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Feature Description

Currently, the vscode-pgsql extension is excellent for query execution, schema browsing, and visualization. However, when it comes to debugging stored procedures and functions written in PL/pgSQL, developers have to switch to external tools like pgAdmin or DBeaver.
The current workflow for debugging in VS Code is non-existent. Debugging server-side logic requires a separate, heavy IDE, which breaks the development flow. Developers want to set breakpoints, step into functions, and inspect variables directly inside VS Code without leaving the editor.

Proposed Capabilities

I propose the integration of the pldebugger extension into the vscode-pgsql workflow, accompanied by a native graphical interface.
The implementation should automate or simplify the following setup steps that are currently manual.

  1. OS-Level Package Installation: First, the pldebugger shared library must be installed on the PostgreSQL server machine. The installation method varies significantly by operating system:
  • Ubuntu/Debian: sudo apt install postgresql-<version>-pldebugger (e.g., postgresql-16-pldebugger)
  • RHEL/Rocky/AlmaLinux: sudo dnf install pldebugger_<version> (e.g., pldebugger_16)
  • Windows: the debugger library (plugin_debugger.dll) is bundled with the EnterpriseDB (EDB) PostgreSQL distribution, typically located in: C:\Program Files\PostgreSQL\<version>\lib\plugin_debugger.dll. If using the EDB installer, no additional OS-level installation is required - the library is present by default.
  1. PostgreSQL Server Configuration (shared_preload_libraries):
    The debugger library must be loaded at server startup. It cannot be added dynamically.
    Required setting in postgresql.conf.
  • Check current setting by executing SHOW shared_preload_libraries;
  • Detect the operating system and suggest the correct library path
  • If plugin_debugger is not present:
    • Show a warning notification with platform-specific instructions
    • Provide the correct postgresql.conf location for the detected OS
    • Include the exact line to add to the configuration file
    • Guide the user to restart PostgreSQL after configuration changes
    • Provide a "Check Again" button after the user confirms the restart
  • Server restart detection: Implement a way to detect if the server has been restarted after config changes (e.g., compare pg_postmaster_start_time before and after)
  1. Database Extension Creation
    After the server restart, the debugger API must be enabled in the target database: CREATE EXTENSION pldbgapi;
    Extension Behavior:
  • Check if the extension already exists: SELECT * FROM pg_extension WHERE extname = 'pldbgapi';
  • If missing, display a prompt: "Debugger API is not installed in this database. Install now?"
  • Provide an "Install" button that executes CREATE EXTENSION pldbgapi; in the current connection.
  • Show a confirmation upon successful installation.

4. GUI Debugger Interface
Once all prerequisites are satisfied, provide a visual debugger within VS Code:

  • Breakpoints: Set/remove breakpoints in .sql or .pgsql files, or directly in the function body editor.
  • Debug Controls: Step Over, Step Into, Step Out, Continue, Stop.
  • Variables Panel: Inspect local variables, parameters, and their values during execution.
  • Call Stack: Show the current execution stack with navigation.
  • Parameter Input: When debugging a function, prompt the user to enter parameter values (types, defaults, etc.).
  • Output Panel: Display debug output, errors, and execution logs.
  • Watch Expressions: Allow users to add custom expressions to monitor

The debugging experience should match the native VS Code Debugger UI (similar to Python, Node.js, or C# extensions), with a dedicated debug view and seamless integration.

Alternatives
  • pgAdmin: While it has a functional debugger, it requires running a separate desktop application and a browser. It lacks the tight integration with the code editor that VS Code provides.
  • DBeaver: Similar to pgAdmin, it is an external tool. It also relies on the same underlying pldebugger extension but offers a less modern UI compared to VS Code's native debugging experience.
Conclusion

Adding PL/pgSQL debugging with a complete cross-platform setup assistant and graphical interface would significantly enhance vscode-pgsql, making it the ultimate PostgreSQL development tool within VS Code. The three-layer setup (OS package → server config → database extension) is non-trivial, but with proper automation and platform-specific guidance, it becomes accessible to all developers, regardless of their operating system or deployment environment.

Lingua principale
Nessun dato sulla lingua
Stelle
395
Fork
33
Merge medio
1g 1h
PR unite (30g)
2

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/vscode-pgsql

Tutte le issue di microsoft/vscode-pgsql

Issue simili

Altre issue su Databases

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.