Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0A61D63350E for ; Wed, 4 Mar 2009 17:45:43 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 21730-06 for ; Wed, 4 Mar 2009 17:45:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mk-filter-4-a-1.mail.uk.tiscali.com (mk-filter-4-a-1.mail.uk.tiscali.com [212.74.100.55]) by mail.postgresql.org (Postfix) with ESMTP id 973F96326B5 for ; Wed, 4 Mar 2009 17:45:39 -0400 (AST) X-Trace: 157446275/mk-filter-4.mail.uk.tiscali.com/B2C/$b2c-THROTTLED-DYNAMIC/b2c-CUSTOMER-DYNAMIC-IP/80.225.101.150/None/john.lister-ps@kickstone.com X-SBRS: None X-RemoteIP: 80.225.101.150 X-IP-MAIL-FROM: john.lister-ps@kickstone.com X-MUA: Thunderbird 2.0.0.19 (Windows/20081209) X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am4BACyFrklQ4WWW/2dsb2JhbAAI2GmECAaGSw X-IronPort-AV: E=Sophos;i="4.38,303,1233532800"; d="scan'208";a="157446275" Received: from ppp-3-150.birm-b-1.access.uk.tiscali.com (HELO [192.168.6.11]) ([80.225.101.150]) by smtp.tiscali.co.uk with ESMTP; 04 Mar 2009 21:45:35 +0000 Message-ID: <49AEF681.4080707@kickstone.com> Date: Wed, 04 Mar 2009 21:45:37 +0000 From: John Lister User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Carol Walter CC: pgsql-admin@postgresql.org Subject: Re: Database in use? References: <23817.1236025942@sss.pgh.pa.us> <91CFD986-3CF6-4419-9908-2FEF9C469441@indiana.edu> <28543.1236029013@sss.pgh.pa.us> <27F905C5-A238-446A-A0E8-21174783E46C@indiana.edu> <1730.1236043881@sss.pgh.pa.us> <1B70D8AC-E1AF-42F2-85D9-92BF3C975ED7@indiana.edu> In-Reply-To: <1B70D8AC-E1AF-42F2-85D9-92BF3C975ED7@indiana.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/61 X-Sequence-Number: 31561 Have you got any copies of psql or tools like pgadmin open. I've been caught out by this. try select * from pg_stat_activity it should tell you what connections are open on the table (look at the datname column) Carol Walter wrote: > This has happened or is happening to me again, only this time, it's a > database that I just created. I restored another database into a test > database. One of the tables is empty. I want to drop the test > database and create a new one. When I try to drop the test database, > I get this error - > template1=# drop database km_tezt; > ERROR: database "km_tezt" is being accessed by other users > > template1=# select * from pg_prepared_xacts; > transaction | gid | prepared | owner | database > -------------+-----+----------+-------+---------- > (0 rows) > > This database is one that I created just a few hours ago just to test > some things myself. There can be no one in it except me. I > completely closed out of the database, closed out of the system, and > closed my terminal session. Still I get the error. This time the > database has not been accessed through PHP at all. > > Carol > > On Mar 2, 2009, at 8:31 PM, Tom Lane wrote: > >> Carol Walter writes: >>> I'm not sure I understand. If there is a lag time between when >>> someone exits the database and when the database "knows" that no one >>> is still in it, then that shouldn't be the problem here. I tried a >>> number of time over the course of 24 hours to rename the database and >>> it always reported that the database was in use. No one was logged in >>> but me, but the database still reported that the database was in use. >> >> Hmph. Are you sure nothing was connected? One thing that frequently >> trips people up here is uncommitted prepared transactions --- look in >> pg_prepared_xacts. >> >> regards, tom lane >> >> -- >> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-admin > >