pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Active users?
2+ messages / 2 participants
[nested] [flat]

* Active users?
@ 1999-06-30 21:00 Brendan McKenna <brendan@w3s.ie>
  1999-07-01 09:42 ` Re: [INTERFACES] Active users? Hannu Krosing <hannu@trust.ee>
  0 siblings, 1 reply; 2+ messages in thread

From: Brendan McKenna @ 1999-06-30 21:00 UTC (permalink / raw)
  To: pgsql-interfaces@hub.org

Hi,

	Is there a reliable way to determine how many (if any) users are 
currently using any given database (or whether or not postgres is currently 
in use) -- short of bringing down the postmaster and restarting it?


						Thanks,
						Brendan
-- 
Brendan McKenna	
Technical Director			Phone: +353-(0)61-338177 x4143
W3 Services Ltd.			  Fax: +353-(0)61-338065
Innovation Centre			Email: brendan@w3s.ie
National Technological Park
Limerick
Ireland





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

* Re: [INTERFACES] Active users?
  1999-06-30 21:00 Active users? Brendan McKenna <brendan@w3s.ie>
@ 1999-07-01 09:42 ` Hannu Krosing <hannu@trust.ee>
  0 siblings, 0 replies; 2+ messages in thread

From: Hannu Krosing @ 1999-07-01 09:42 UTC (permalink / raw)
  To: Brendan McKenna <brendan@w3s.ie>; +Cc: pgsql-interfaces@hub.org

Brendan McKenna wrote:
> 
> Hi,
> 
>         Is there a reliable way to determine how many (if any) users are
> currently using any given database (or whether or not postgres is currently
> in use) -- short of bringing down the postmaster and restarting it?

You can get the needed info using ps (or top)

The following is in linux (on other systens the flags to ps may differ):

[hannu@kodu hannu]$ ps ax | grep postgres
  604  p1 S    0:00 grep postgres
  600  ?  S    0:00 /usr/bin/postgres localhost hannu unidocu idle

the 8th field is db name, so you can probably write a short script 
(sh, awk, python, perl, ...) to do the counting.

the fields >8 is current command, so yo can check what your backends are
doing.

---------------------
Hannu



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


end of thread, other threads:[~1999-07-01 09:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-06-30 21:00 Active users? Brendan McKenna <brendan@w3s.ie>
1999-07-01 09:42 ` Hannu Krosing <hannu@trust.ee>

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