When you execute drop database command, database get an error like ERROR: database “database_name” is being accessed by other users.>
You have to kill backend process. Firstly, you have fecth backend process.
SQL> SELECT pid,datname FROM pg_stat_activity where pid <> pg_backend_pid();
SQL> SELECT pg_terminate_backend($pid);