SyntaxFix
Write A Post
Hire A Developer
Questions
This worked for me:
select pg_terminate_backend(pid) from pg_stat_activity where datname='YourDatabase';
for postgresql earlier than 9.2 replace pid with procpid
pid
procpid
DROP DATABASE "YourDatabase";
http://blog.gahooa.com/2010/11/03/how-to-force-drop-a-postgresql-database-by-killing-off-connection-processes/