I'm investigating an issue with DB connections being left open indefinitely, causing problems on the DB server. How do I see currently open connections to a PostgreSQL server, particularly those using a specific database? Ideally I'd like to see what command is executing there as well. Basically, I'm looking for something equivalent to the "Current Activity" view in MSSQL.
|
feedback
|
|
OK, got it from someone else. This query does the trick:
| |||
|
feedback
|
|
from PostgreSQL 9.0 on you will even see the name of the application causing the problem. maybe this is helpful for future checks. | |||
|
feedback
|
|
See also [pg-top][1], which acts like top except it shows postgres activity.
| |||||
feedback
|