Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B6782633220 for ; Mon, 2 Mar 2009 16:32:28 -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 02163-07 for ; Mon, 2 Mar 2009 16:32:26 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 061F3632987 for ; Mon, 2 Mar 2009 16:32:25 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n22KWMwD023818; Mon, 2 Mar 2009 15:32:22 -0500 (EST) To: Carol Walter cc: pgsql-admin@postgresql.org Subject: Re: Database in use? In-reply-to: References: Comments: In-reply-to Carol Walter message dated "Mon, 02 Mar 2009 15:17:30 -0500" Date: Mon, 02 Mar 2009 15:32:22 -0500 Message-ID: <23817.1236025942@sss.pgh.pa.us> From: Tom Lane 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/21 X-Sequence-Number: 31521 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