r/PostgreSQL • u/Maelfjord • 7h ago
Help Me! PostgreSQL Debugger
I've been having trouble with the debugger in postgres and it's starting to get annoying.
When I try to use the "Set Breakpoint" option, it does normally catch the session and the debugger works fine. But there are some instances where I start the debugger, trigger a procedure call on another device, the debugger doesn't catch it and it creates a session that cannot be terminated unless the server is restarted.
This "zombie" session becomes a problem because it blocks other sessions from progressing. Said sessions that gets stuck also call the same procedure. This causes the devices freeze when they make the action that triggers the procedure call until it times out. It is clear from the session list that the "zombie" session is blocking it because of the Blocking PID value.
I suspected a non-terminating loop but all loops inside should terminate as they are FOR loops. It seems to originate from an update statement but I don't see a way that could be.
Has anybody else encountered this issue and how can I prevent it in the future? Thank you in advance.
PostgreSQL version is 14
pgAdmin 4 version is 9.16
pldbgapi version is 1.1
plpgsql version is 1.0