Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A2F6F9FA553 for ; Fri, 26 Oct 2007 20:09:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 00149-02 for ; Fri, 26 Oct 2007 20:09:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 818649FA01C for ; Fri, 26 Oct 2007 20:09:24 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l9QN90UE001066; Fri, 26 Oct 2007 19:09:00 -0400 (EDT) To: "Milen A. Radev" cc: pgsql-admin@postgresql.org, Naomi Walker Subject: Re: Find the Person Connected to a Database In-reply-to: References: <26960.1193434395@sss.pgh.pa.us> <20071026144005.3aa6cc29@scratch> <27413.1193435100@sss.pgh.pa.us> <472262A5.2020605@mhs.mphasis.com> Comments: In-reply-to "Milen A. Radev" message dated "Sat, 27 Oct 2007 01:22:53 +0300" Date: Fri, 26 Oct 2007 19:09:00 -0400 Message-ID: <1065.1193440140@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/275 X-Sequence-Number: 27189 "Milen A. Radev" writes: > Naomi Walker написа: >> I'm trying to drop a database in a postgres 8.1.4 instance (x86 Solaris >> 10 OS), but someone is connected to >> the database. What is the best way to find out exactly who is connected? > select * from pg_stat_activity where datname = ; If that doesn't work because you've got stats collection turned off, "ps" will help too: http://www.postgresql.org/docs/8.1/static/monitoring.html On Solaris, note the Tip at the bottom (not sure if it applies to recent Solaris versions but a few years ago it was critical). regards, tom lane