I can\'t seem to reset my database while using docker compose. I\'ve tried killing the server, killing just the database, and restarting the machine.
Anyone know the
You are using the wrong database.
The database postgres
is normally not used for user data, but for administrative purposes. For example, if you want to drop a database, you have to be connected to a different database in the PostgreSQL database cluster to issue the SQL statement DROP DATABASE
. Normally, the database postgres
is used for that purpose, and I have no doubt that Docker does exactly that when it tries to drop a database.
If you really want to drop the database postgres
, you'd have to connect to some other database in the cluster. The correct solution, however, is to keep your data in a different database. Then the problem should go away by itself.