Disconnecting from the server
Hi, ALL.
Let's say I'm debugging my application.
I establish a successful connection to the server and start
debugging.
During the debugging session I found a bug/issue.
In this case what I usually do is I stop and exit the debugger
essentially imitating the program crash.
What will happen in this case?
I presume the connection will be closed the socket becomes
available and the server will clear all resources associated with the
connection?
Or should I perform some clean-up on the server - some kind of "connection
pool reset" so that the resources associated with the connection will be
gone?
Please clarify.
Thank you.
On Saturday, May 16, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Or should I perform some clean-up on the server - some kind of "connection
pool reset" so that the resources associated with the connection will be
gone?
There server doesn’t have a connection pool.
You can inspect what is connected to the server via the pg_stat_activity
view.
https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW
David J.
Hi, David,
On Sat, May 16, 2026 at 9:50 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
On Saturday, May 16, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Or should I perform some clean-up on the server - some kind of "connection
pool reset" so that the resources associated with the connection will be
gone?There server doesn’t have a connection pool.
There is a reason I put quotes around that phrase. ;-)
You can inspect what is connected to the server via the pg_stat_activity view.
https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW
Thank you for the info.
I checked and there are no processes running.
Which means I don't need to clean up anything. ;-)
Show quoted text
David J.