-1

Image org.apatche.commons.pool2. Show numActive connection

I have many connection from java server application.

How get numActive connection (like jconsole) on PostgreSQL server? Thanks

Anton Patsev
  • 605
  • 2
  • 13
  • 27

1 Answers1

1

The simple answer is:

SELECT datname, count(*) FROM pg_stat_activity
  WHERE state != 'idle' GROUP BY datname;

Is that what you're looking for? It seems from your question like there is something else going on, but without more detail it's impossible to say.

jmelesky
  • 3,710
  • 1
  • 24
  • 24