Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id ABE1E1337B68 for ; Tue, 9 Nov 2010 22:32:08 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 55302-02 for ; Wed, 10 Nov 2010 02:32:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.egcrc.net (mail.egcrc.net [63.193.204.10]) by mail.postgresql.org (Postfix) with ESMTP id B29571336B42 for ; Tue, 9 Nov 2010 22:32:00 -0400 (AST) Received: from EGCRC-EX04.egcrc.org ([::1]) by EGCRC-EX03.egcrc.org ([::1]) with mapi; Tue, 9 Nov 2010 18:31:49 -0800 From: Tena Sakai To: Samuel Stearns , "pgsql-admin@postgresql.org" Date: Tue, 9 Nov 2010 18:31:48 -0800 Subject: Re: I want to find out who is using a database Thread-Topic: I want to find out who is using a database Thread-Index: AcuAfROzfb1bZCtqTb6tgYv7Z2dndQAAWujwAAAiQ2k= Message-ID: In-Reply-To: <68B59BEDCD36854AADBDF17E91B2937A0783A72309@EXCHMAIL.staff.internode.com.au> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-Entourage/13.4.0.100208 acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_C8FF436CD070tsakaigalloucsfedu_" MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201011/72 X-Sequence-Number: 36038 --_000_C8FF436CD070tsakaigalloucsfedu_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Thank you, Sam. Tena On 11/9/10 6:25 PM, "Samuel Stearns" wrote: Psql template1 Select * from pg_stat_activity; Sam From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql= .org] On Behalf Of Tena Sakai Sent: Wednesday, 10 November 2010 12:48 PM To: pgsql-admin@postgresql.org Subject: [ADMIN] I want to find out who is using a database Hi Everybody, I want to drop a database and recreate it from a backup file. But when I issue a dropdb command it wouldn=92t let me do so. It tells me: database xxxxx is being accessed by other users. Can somebody please tell me how I find who it is using the xxxxx database? Thank you. Regards, Tena Sakai tsakai@gallo.ucsf.edu --_000_C8FF436CD070tsakaigalloucsfedu_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Re: I want to find out who is using a database Thank you, Sam.

Tena


On 11/9/10 6:25 PM, "Samuel Stearns" <SStearns@internode.com.au> wrote:

Psql template1
 
Select * from pg_stat_activity;
 
Sam
 

From: pgsql-admin-owner@postgresql.org = [mailto:pgsql-admin-own= er@postgresql.org] On Behalf Of Tena Sakai
Sent: Wednesday, 10 November 2010 12:48 PM
To: pgsql-admin@postgresql.or= g
Subject: [ADMIN] I want to find out who is using a database

Hi Everybody,

I want to drop a database and recreate it from a backup file.
But when I issue a dropdb command it wouldn=92t let me do
so.  It tells me: database xxxxx is being accessed by other
users.

Can somebody please tell me how I find who it is using the
xxxxx database?

Thank you.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu


--_000_C8FF436CD070tsakaigalloucsfedu_--