I was trying to drop a database from user interface, but it came up with "Could not drop database" error message, I also tried to drop it from terminal by using : sudo -u postgres dropdb db_to_drop, but it showed up with :
could not change directory to "/root"
dropdb: database removal failed: ERROR: database "db_to_drop" is being accessed by other users
DETAIL: There are 17 other session(s) using the database.
There are no other users connected while I was trying to drop this database. How this can be done ?
Thanks a lot.
Thanks for he reply, in fact, the key solution was to restart postgresql service at least 2 times, with : sudo service postgresql restart, this automatically loged out users from postgresql, and give me the possibility to drop the desired database, with : sudo -u postgres dropdb db_to_drop.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 7/21/14, 12:02 PM|
|Seen: 1279 times|
|Last updated: 3/16/15, 8:10 AM|