Summary
I am trying to do a db restore from docker by declaring
- ./db/postgres.sql:/docker-entrypoint-initdb.d/initdb.sql
Inside docker-compose.yml
Observed behavior
However I am getting this error message from the docker db logs
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/initdb.sql
SET
SET
SET
ERROR: cannot drop the currently open database
STATEMENT: DROP DATABASE mattermost;
psql:/docker-entrypoint-initdb.d/initdb.sql:14: ERROR: cannot drop the currently open database
I have tried multiple ways to declare the initdb but keeps having the same problem. I know I can restore it by doing docker exec -i mattermost_db_1 psql -U mmuser mattermost < db/postgres.sql but I want to avoid that method if possible