Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 647B2633AD0 for ; Mon, 2 Mar 2009 16:50:40 -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 21474-05 for ; Mon, 2 Mar 2009 16:50:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hartman.uits.indiana.edu (hartman.uits.indiana.edu [129.79.1.194]) by mail.postgresql.org (Postfix) with ESMTP id BBF9E633220 for ; Mon, 2 Mar 2009 16:50:14 -0400 (AST) Received: from mail-relay.iu.edu (candy.uits.indiana.edu [129.79.1.201]) by hartman.uits.indiana.edu (8.14.2/8.13.8/IU Messaging Team) with ESMTP id n22KoCf2030448 for ; Mon, 2 Mar 2009 15:50:12 -0500 Received: from walter.slis.indiana.edu (walter.slis.indiana.edu [129.79.36.69]) (authenticated bits=0) by mail-relay.iu.edu (8.14.2/8.13.8/IU Messaging Team) with ESMTP id n22KoBOL004400 for ; Mon, 2 Mar 2009 15:50:12 -0500 Cc: pgsql-admin@postgresql.org Message-Id: <91CFD986-3CF6-4419-9908-2FEF9C469441@indiana.edu> From: Carol Walter In-Reply-To: <23817.1236025942@sss.pgh.pa.us> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Database in use? Date: Mon, 2 Mar 2009 15:50:11 -0500 References: <23817.1236025942@sss.pgh.pa.us> X-Mailer: Apple Mail (2.930.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.581 tagged_above=0 required=5 tests=MISSING_HEADERS=1.581, RCVD_IN_DNSWL_LOW=-1 X-Spam-Level: X-Archive-Number: 200903/24 X-Sequence-Number: 31524 Well, most recently I had created a new database using UTF8 encoding and I had restored data to it, that had been in a database using SQL_ASCII. I wanted to rename the original database. When I tried to rename it, I got the message that I couldn't do it because the database was in use. This particular database is in a 8.2.4 release. I'm moving to 8.3.n but I'm not there yet. Carol On Mar 2, 2009, at 3:32 PM, Tom Lane wrote: > Carol Walter writes: >> Periodically, my databases will give me a message that says that >> someone is using the database when it appears that no one is. What >> causes this? What can I do about it? > > What's the context exactly? > > In some cases you can get this type of message because of the fact > that > it takes finite time for an existing backend to exit. For instance in > > psql -c "some command" somedb > dropdb somedb > > there's a nonzero probability that the backend launched for the psql > session will still exist when the dropdb runs. Recent PG versions > have > a hack in DROP DATABASE to wait a little bit to see if conflicting > backends will exit; but maybe you're running a version that hasn't got > that patch, or maybe you're doing something else. > > 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