Skip site navigation (1) Skip section navigation (2)

Re:

From: Farhan Mughal <farhanhafeezmughal(at)yahoo(dot)co(dot)uk>
To: "Sherrylyn\(Work\)" <shines(at)datasof(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re:
Date: 2007-10-18 18:25:17
Message-ID: 271873.16944.qm@web26311.mail.ukl.yahoo.com (view raw or flat)
Thread:
Lists: 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(at)datasof(dot)com>
To: pgsql-admin(at)postgresql(dot)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(at)postgresql(dot)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

pgsql-admin by date

Next:From: Irina SourikovaDate: 2007-10-18 18:59:27
Subject: Re: does vacuumlo removes BLOBs from deleted tables?
Previous:From: Brad NicholsonDate: 2007-10-18 18:01:02
Subject: Re: BGWRITER in Postgres 8.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group