pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re:
1+ messages / 1 participants
[nested] [flat]

* Re:
@ 2007-10-18 18:25  Farhan Mughal <farhanhafeezmughal@yahoo.co.uk>
  0 siblings, 0 replies; 1+ messages in thread

From: Farhan Mughal @ 2007-10-18 18:25 UTC (permalink / raw)
  To: Sherrylyn\(Work\) <shines@datasof.com>; pgsql-admin

>>Does any one know how I would get a list of users currently
 connected to a
>>postgres database?


You can view all the database activity by:

select * from pg_stat_activity;

I am not sure about users, but i guess this should serve the purpose:

select COUNT(DISTINCT(client_addr)) from pg_stat_activity;

--Farhan 


----- Original Message ----
From: Sherrylyn(Work) <shines@datasof.com>
To: pgsql-admin@postgresql.org
Sent: Thursday, 18 October, 2007 10:42:06 PM
Subject: [ADMIN] 

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






      ___________________________________________________________ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  http://uk.promotions.yahoo.com/forgood/environment.html

^ permalink  raw  reply  [nested|flat] 1+ messages in thread


only message in thread

Thread overview: 1+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-10-18 18:25 Re: Farhan Mughal <farhanhafeezmughal@yahoo.co.uk>

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