Search Postgresql Archives

Re: dropdb: database removal failed: active sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 29, 2011 at 2:39 PM, John R Pierce <pierce@xxxxxxxxxxxx> wrote:
> any connection to the database, even idle, will prevent a drop database.
>
> try...
>
>    select pg_terminate_backend(procpid) from pg_stat_activity where datname
> = 'database1';
>
> that will snuff those processes.  then you can drop the database, assuming
> the clients don't immediately reconnect.

If you lose your connection at this point you'll know who was
connected to that database as well.

Yes, I have done that before.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux