Re: Cannot drop database that is in use (NOT)

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Cannot drop database that is in use (NOT)
Date: 2001-07-02 16:08:23
Message-ID: Pine.LNX.4.30.0107021806110.677-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Gary Stainburn writes:

> ERROR: DROP DATABASE: Database "revcom" is being accessed by other users

> I know that there is nobody using the database, so I can only assume it is
> some left-over garbage from my first every php script (as I don't know how to
> close the link openned by pg_pconnect).
>
> How do I close any pending connections and reset the usage count so that I
> can drop the database?

Either follow the advice at
http://www.php.net/manual/en/function.pg-pconnect.php or kill the
PostgreSQL backend process. (Look with ps ax. With luck you might
identify the process which is using that database from the command line
that ps shows.) All in all you will find that persistent connections and
volatile databases don't mix well.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jie Liang 2001-07-02 18:46:42 Re: Cannot drop database that is in use (NOT)
Previous Message Gary Stainburn 2001-07-02 15:04:46 Cannot drop database that is in use (NOT)