Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 507539FB282 for ; Thu, 18 Oct 2007 15:25:23 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 21751-08 for ; Thu, 18 Oct 2007 15:25:17 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web26311.mail.ukl.yahoo.com (web26311.mail.ukl.yahoo.com [217.146.177.48]) by postgresql.org (Postfix) with SMTP id 23C479FBC4E for ; Thu, 18 Oct 2007 15:25:18 -0300 (ADT) Received: (qmail 18427 invoked by uid 60001); 18 Oct 2007 18:25:17 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=w/jciXrXsTQ7pXSUEw2n1pN6Zso96xlNJHHjT+zkmHkxqcdJYaQ3s0W6dZvOK8/X98aGoEo87A50P8xJFsf99lCukHM/giL7GuSZzlOAYjefsNs/aZpgZRSHolZF4hOhGQEXi1ZkegL6yeQANO6Ru3On4F9/yIuaL6UYSZFZEP0=; X-YMail-OSG: k8kCm7YVM1mx6oxfE44OdOzjtqCezCzjBXJ8xbHCSEN_2aUi7HRhsQguWJBxhX6qTpSyuwMQCTxPi2zhKS6NE4rQFPssdWT.u62dhwins_kU3rQR.3YoVgYEku8- Received: from [203.215.160.146] by web26311.mail.ukl.yahoo.com via HTTP; Thu, 18 Oct 2007 18:25:17 GMT X-Mailer: YahooMailRC/814.06 YahooMailWebService/0.7.134.12 Date: Thu, 18 Oct 2007 18:25:17 +0000 (GMT) From: Farhan Mughal Subject: Re: To: "Sherrylyn\(Work\)" , pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1528291791-1192731917=:16944" Message-ID: <271873.16944.qm@web26311.mail.ukl.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.031 tagged_above=0 required=5 tests=AWL=0.215, BAYES_40=-0.185, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200710/179 X-Sequence-Number: 27093 --0-1528291791-1192731917=:16944 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable >>Does any one know how I would get a list of users currently=0A connected = to a=0A>>postgres database?=0A=0A=0AYou can view all the database activity = by:=0A=0Aselect * from pg_stat_activity;=0A=0AI am not sure about users, bu= t i guess this should serve the purpose:=0A=0Aselect COUNT(DISTINCT(client_= addr)) from pg_stat_activity;=0A=0A--Farhan =0A=0A=0A----- Original Message= ----=0AFrom: Sherrylyn(Work) =0ATo: pgsql-admin@postgr= esql.org=0ASent: Thursday, 18 October, 2007 10:42:06 PM=0ASubject: [ADMIN] = =0A=0AHi ,=0A Does any one know how I would get a list of users currentl= y=0A connected to a=0Apostgres database? In Oracle, I could select from the= vg$sessions=0A table. Is=0Athere a corollary table in Postgres?=0A=0A=0A--= -------------------------(end of=0A broadcast)---------------------------= =0ATIP 1: if posting/reading through Usenet, please send an appropriate=0A = subscribe-nomail command to majordomo@postgresql.org so that=0A your= =0A message can get through to the mailing list cleanly=0A=0A=0A=0A= =0A=0A=0A ___________________________________________________________ = =0AWant ideas for reducing your carbon footprint? Visit Yahoo! For Good ht= tp://uk.promotions.yahoo.com/forgood/environment.html --0-1528291791-1192731917=:16944 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
>>Does any one know how I would get a list of= users currently=0A connected to a
>>postgres database?

You can view all the database activity by:

select * from pg_stat_ac= tivity;

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: S= herrylyn(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 us= ers currently=0A connected to a
postgres database? In Oracle, I could se= lect from the vg$sessions=0A table. Is
there a corollary table in Postgr= es?


---------------------------(end of=0A broadcast)------------= ---------------
TIP 1: if posting/reading through Usenet, please send an= appropriate
      subscribe-nomail command to majordomo@postgresql.org so that=0A your
      m= essage can get through to the mailing list cleanly


=0A=0A=0A
=0AFor ideas on reducing your carbon foot= print visit Yahoo! For Good this month.=0A --0-1528291791-1192731917=:16944--