select
*
from
pg_stat_activity
where
datname = (
select
*
from
current_database()
);
-------- Original Message --------
Subject: [GENERAL] any way to query for current connections to db?
From: "Coarr, Matt" <mcoarr(at)mitre(dot)org>
Date: Fri, November 09, 2007 5:36 pm
To: <pgsql-general(at)postgresql(dot)org>
Hi,
Is there any way to query the database to identify what the current
connections are (connections, sessions, or whatever you want to call
them)?
This would be something similar to oracle's v$session view.
Thanks,
Matt