DROP DATABASE and other users
22 Feb 2016From time to time, when I’ve gone and issued DROP DATABASE
on my postgres server, I’m returned with the following error:
All this is telling us is that we need to be the only user/connection on the database before performing such an operation.
First of all, we need to prevent other users from making a connection to the database from this point. To do this, we’ll use REVOKE CONNECT
like so:
Next, we kill off every connection:
Now you can issue your DROP DATABASE
.