Restores backup taken by pg_dump
Run in first terminal window (with or without -d, as you prefer, just make sure it's running):
COMPRESS_ENABLED=1 docker compose -f docker-compose.dev.yml up
Run in second terminal window:
docker compose -f docker-compose.dev.yml exec web psql -h postgres -U postgres
In Postgres shell:
create database temp;
(If it already exists that's fine, carry on)
\connect temp
drop database postgres;
create database postgres;
\q
Back on command line:
docker compose -f docker-compose.dev.yml exec web pg_restore -v -h postgres -U postgres -d postgres /usr/src/app/filename.dump
At the end, a whole range of "role ?? does not exist" errors are fine.
Restores backup taken by pg_dump
Run in first terminal window (with or without -d, as you prefer, just make sure it's running):
Run in second terminal window:
In Postgres shell:
Back on command line:
At the end, a whole range of "role ?? does not exist" errors are fine.