Whenever I try to drop database I get:
ERROR: database \"pilot\" is being accessed by other users
DETAIL: There is 1 other session using the database.
GUI solution using pgAdmin 4
First enable show activity on dashboard if you haven't:
File > Preferences > Dashboards > Display > Show Activity > true
Now disable all the processes using the db:
You should now be able to delete the db.