pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Farhan Mughal <farhanhafeezmughal@yahoo.co.uk>
To: Sherrylyn\(Work\) <shines@datasof.com>
To: pgsql-admin@postgresql.org
Subject: Re:
Date: Thu, 18 Oct 2007 18:25:17 +0000 (GMT)
Message-ID: <271873.16944.qm@web26311.mail.ukl.yahoo.com> (raw)

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

Message-ID: <271873.16944.qm@web26311.mail.ukl.yahoo.com>
Permalink:  ../271873.16944.qm@web26311.mail.ukl.yahoo.com/
Also on:    postgresql.org/message-id/271873.16944.qm@web26311.mail.ukl.yahoo.com

 · 

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: farhanhafeezmughal@yahoo.co.uk, shines@datasof.com
  Subject: Re:
  In-Reply-To: <271873.16944.qm@web26311.mail.ukl.yahoo.com>

* 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