R
R
romaro2021-10-18 03:13:15
PostgreSQL
romaro, 2021-10-18 03:13:15

How to monitor active connections to Postgres?

I'm connecting to postgers via the node-postgres library (creating a connection pool) and would like to see all active database connections for debugging purposes. What's the best way to ask them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2021-10-18
@gbg

SELECT * FROM pg_stat_activity WHERE datname = 'dbname' and state = 'active';

Source

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question