Answer the question
In order to leave comments, you need to log in
Docker and uploading large sql files?
In migrations, you have to load large sql files. I found a command to speed up this process:
cat test.sql | docker exec -i name_container_db_host_1 psql -U name_user -d name_db
docker exec -i name_container_db_host_1 psql -U name_user -d name_db -f test.sql
Answer the question
In order to leave comments, you need to log in
In order for the container to see the file in the second command, it (the file) must be placed in an already existing bind mount (in the case of PG, this is usually the host directory into which it is mapped in the container /var/lib/postgresql/data
), there are no other ways.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question