Re:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>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@xxxxxxxxxxx>
To: pgsql-admin@xxxxxxxxxxxxxx
Sent: Thursday, 18 October, 2007 10:42:06 PM
Subject:

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@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly



For ideas on reducing your carbon footprint visit Yahoo! For Good this month.

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux