On this Post, I will add my notes while handling some of the issues with Postgres database
Issue-1 ERROR: database “sumitdb” is being accessed by other users
I was trying to delete the database sumitdb, but it was showing below issue,
[2019-11-09 18:53:07]  ERROR: database “sumitdb” is being accessed by other users
[2019-11-09 18:53:07] Detail: There is 1 other session using the database.
Did the following two steps :
REVOKE CONNECT ON DATABASE sumitdb FROM public; SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'sumitdb';
Step-2 : drop database notifications