DEV Community

Cover image for Debugging postgres: List all connections
Stefan Ukena
Stefan Ukena

Posted on • Originally published at blog.ukena.de on

Debugging postgres: List all connections

Sometimes want a list of all connections to your postgres database. Postgres maintains this list in an internal datastructure that you simply query like this: SELECT * FROM pg_stat_activity; This will give you something like this (I have removed many columns to make it more readable here): state application_name client_addr wait_event NULL NULL AutoVacuumMain NULL NULL LogicalLauncherMain idle test.

Top comments (0)