Debugging PostgreSQL connections requires stopping a backend before it does anything interesting. (I consult on PostgreSQL through PGX Inc..)