Re: Cannot drop database that is in use (NOT) - Mailing list pgsql-admin

From Peter Eisentraut
Subject Re: Cannot drop database that is in use (NOT)
Date
Msg-id Pine.LNX.4.30.0107021806110.677-100000@peter.localdomain
Whole thread Raw
In response to Cannot drop database that is in use (NOT)  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
List 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@gmx.net   http://funkturm.homeip.net/~peter


pgsql-admin by date:

Previous
From: Gary Stainburn
Date:
Subject: Cannot drop database that is in use (NOT)
Next
From: Jie Liang
Date:
Subject: Re: Cannot drop database that is in use (NOT)