# su - postgres
#psql
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='<dbname>';
DROP DATABASE <dbname>;
CREATE DATABASE <dbname>;
#psql
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='<dbname>';
DROP DATABASE <dbname>;
CREATE DATABASE <dbname>;