Received: from kodu.home.ee (isdn-54.uninet.ee [194.204.0.118]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA55663 for ; Thu, 1 Jul 1999 09:54:27 -0400 (EDT) (envelope-from hannu@trust.ee) Received: from trust.ee (hannu@localhost [127.0.0.1]) by kodu.home.ee (8.8.7/8.8.7) with ESMTP id MAA00608; Thu, 1 Jul 1999 12:42:21 +0300 Sender: hannu@kodu.home.ee Message-ID: <377B37FC.C7B065A4@trust.ee> Date: Thu, 01 Jul 1999 12:42:20 +0300 From: Hannu Krosing Organization: Trust-O-Matic =?iso-8859-1?Q?O=DC?= X-Mailer: Mozilla 4.5 [en] (X11; U; Linux 2.2.6 i686) X-Accept-Language: en MIME-Version: 1.0 To: Brendan McKenna CC: pgsql-interfaces@hub.org Subject: Re: [INTERFACES] Active users? References: <199906301953.UAA00636@w3s.ie> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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