Debugging your PL/pgSQL code
summary
Debugging PL/pgSQL uses two concrete tools: the PL debugger (shippped in BigSQL, requires shared_preload_libraries and pgAdmin3) that lets sessions step, set global breakpoints on triggers and mutate variables mid‑run, and the PL profiler that produces flame graphs and pinpoints hot lines. A real case shows a tiny dynamic SQL line calling get_new_sequence called 8 million times, where fixing index column order shrinks a 10–15 minute run to 1.6s and doubles throughput.
AI-written summary · about
chapters (18)
- 0:00Start
- 0:27Who Am I?
- 1:59Why?
- 3:44Example
- 5:07Database Developer
- 5:41Web Developer
- 8:13How?
- 10:16Fantasy Football
- 10:52Business Rules
- 11:23Sample Schema
- 11:53Procedures
- 13:41Debugging: RAISE
- 14:41Debugger
- 27:45Debugging Triggers
- 28:48Track Functions
- 30:05Profiler
- 35:19Real Use Case
- 39:26Summary
related talks
18mApparently, you can "debug" your SQL queries
47mIdentifying Slow Queries and Fixing Them!
47mDebugging active queries...
39mAccelerating PL/pgSQL Code Conversion
22mAccelerating PL/pgSQL Code Conversation When Migrating to Postgres
57mQuery Logging and Workload Analysis
44mPostgreSQL for Developers
50mEffective PL/SQL Code Insight With PL/Scope–or another reason to put code in the dtb
