PSQL HOW TO DROP DATABASE code example
Example 1: postgres delete database
CREATE DATABASE testdb1;
DROP DATABASE testdb1;
Example 2: postgres delete database
DROP DATABASE db_name;
Example 3: how to hard drop database in postgres
It means another user is accessing the database. Simply restart PostgreSQL. This command will do the trick
root@kalilinux:~#sudo service postgresql restart
Then try dropping the database:
postgres=# drop database test_database;
This will do the trick.