pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alex Kloss <alexkloss@att.net>
To: Sherrylyn(Work) <shines@datasof.com>
To: pgsql-admin@postgresql.org
Subject: Re:
Date: Thu, 18 Oct 2007 18:22:48 -0400
Message-ID: <4717DCB8.6010202@att.net> (raw)
In-Reply-To: <CMEJKBFEPGKJNAFBEFHLGEALDCAA.shines@datasof.com>
References: <CMEJKBFEPGKJNAFBEFHLGEALDCAA.shines@datasof.com>

-----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-----




view thread (2+ messages)

Message-ID: <4717DCB8.6010202@att.net>
Permalink:  ../4717DCB8.6010202@att.net/
Also on:    postgresql.org/message-id/4717DCB8.6010202@att.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: alexkloss@att.net, shines@datasof.com
  Subject: Re:
  In-Reply-To: <4717DCB8.6010202@att.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox