pg_stat_activity
pg_stat_activity is one of PostgreSQL's most important system views (in the pg_catalog schema). It provides a real-time snapshot of all server processes (backends) and their current activity on the database instance. Each row represents one backend process (typically one client connection/session, plus some