Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id E9D779FC42F for ; Thu, 18 Oct 2007 19:27:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 49723-03 for ; Thu, 18 Oct 2007 19:27:52 -0300 (ADT) X-Greylist: delayed 00:05:00.824337 by SQLgrey-1.7.5 Received: from mtiwmhc11.worldnet.att.net (mtiwmhc11.worldnet.att.net [204.127.131.115]) by postgresql.org (Postfix) with ESMTP id 0CAC09FC385 for ; Thu, 18 Oct 2007 19:27:51 -0300 (ADT) Received: from [192.168.1.104] (h220.13.17.98.ip.alltel.net[98.17.13.220]) by worldnet.att.net (mtiwmhc11) with ESMTP id <2007101822224911100qlefke>; Thu, 18 Oct 2007 22:22:49 +0000 Message-ID: <4717DCB8.6010202@att.net> Date: Thu, 18 Oct 2007 18:22:48 -0400 From: Alex Kloss User-Agent: Thunderbird 2.0.0.5 (X11/20070727) MIME-Version: 1.0 To: "Sherrylyn(Work)" , pgsql-admin@postgresql.org Subject: Re: References: In-Reply-To: X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/183 X-Sequence-Number: 27097 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sherrylyn(Work) wrote: > Hi , > Does any one know how I would get a list of users currently connected to a > postgres database? In Oracle, I could select from the vg$sessions table. Is > there a corollary table in Postgres? > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > SELECT usename FROM pg_stat_activity WHERE datname='databasename' There's many other connection statistics in pg_stat_activity as well, such as IP address, current query... Alex Rowe -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFHF9y3LGN3BhEHOicRAmOpAJ9ia+gYRRRJORBCXEvnwur3tIScEgCdHugX E4fzATbhmA0SxYtIQ986xyQ= =deCX -----END PGP SIGNATURE-----