Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A3D17650E87 for ; Thu, 3 Jul 2008 16:55:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 53921-08 for ; Thu, 3 Jul 2008 16:55:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lb-2.01.com (smtp.01.com [38.98.186.166]) by postgresql.org (Postfix) with ESMTP id 8E9FB64FD64 for ; Thu, 3 Jul 2008 16:55:31 -0300 (ADT) Received: from asav-1.01.com (localhost.localdomain [127.0.0.1]) by asav-1.01.com (8.13.1/8.13.1) with SMTP id m63JtFHr015422; Thu, 3 Jul 2008 14:55:15 -0500 Received: from smtp-1.01.com (smtp-1.01.com [38.98.186.157]) by asav-1.01.com (asav-1.01.com [10.25.1.11]) id k62EyF27722338078r ret-id none; Thu, 03 Jul 2008 14:55:15 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-1.01.com (Postfix) with ESMTP id 8718AE110C; Thu, 3 Jul 2008 14:55:15 -0500 (CDT) Received: from smtp-1.01.com ([127.0.0.1]) by localhost (smtp-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id adrxGOqhCsT9; Thu, 3 Jul 2008 14:55:15 -0500 (CDT) Received: from [10.10.10.18] (adsl-69-226-247-183.dsl.pltn13.pacbell.net [69.226.247.183]) by smtp-1.01.com (Postfix) with ESMTP id 2719EE10F2; Thu, 3 Jul 2008 14:55:15 -0500 (CDT) Message-ID: <486D2EA2.7040805@frostconsultingllc.com> Date: Thu, 03 Jul 2008 12:55:14 -0700 From: Jeff Frost Organization: Frost Consulting, LLC User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Carol Walter CC: pgsql-admin@postgresql.org Subject: Re: Who's attached to the database? References: <9CB3C6A7-9E59-4A40-94BB-C2EE4150EC21@indiana.edu> In-Reply-To: <9CB3C6A7-9E59-4A40-94BB-C2EE4150EC21@indiana.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-FSL-MailScanner-Information: Please contact postmaster@01.com for more information X-FSL-MailScanner: Found to be clean X-FSL-MailScanner-SpamCheck: X-FSL-MailScanner-From: jeff@frostconsultingllc.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/52 X-Sequence-Number: 29662 Carol Walter wrote: > I'm trying to drop a database and I'm getting an error that says that > the database is being accessed by other users. Is there a way I can > find out who these users are or if there really is a user accessing it? Carol, depending on version and options turned on in the postgresql.conf, you probably can have a look in the pg_stat_activity system view: SELECT datname, client_addr FROM pg_stat_activity WHERE datname = ''; Otherwise, you can also have a look at the command line on linux servers like this: ps -ef|grep postgres or ps aux | grep postgres depending what ps variant your system includes. -- Jeff Frost, Owner Frost Consulting, LLC http://www.frostconsultingllc.com/ Phone: 650-780-7908 FAX: 650-649-1954