Last active
March 8, 2024 17:51
-
-
Save jgillman/8191d6f587ffc7207a88e987e034b675 to your computer and use it in GitHub Desktop.
pg_restore a local db dump into Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes the database container is named 'db' | |
DOCKER_DB_NAME="$(docker-compose ps -q db)" | |
DB_HOSTNAME=db | |
DB_USER=postgres | |
LOCAL_DUMP_PATH="path/to/local.dump" | |
docker-compose up -d db | |
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}" | |
docker-compose stop db |
pg_restore: [archiver] input file is too short (read 0, expected 5) error why ?
x2
pg_restore: [archiver] input file is too short (read 0, expected 5) error why ?
did you ever solved it?
Your dump is probably empty or the argument on docker exec are missing.
Could you cat
your dump and paste the command you use ?
pg_restore: [archiver] input file is too short (read 0, expected 5) error why ?
x2
x3
Did you forget the -i
option in docker command by chance?
did somebody solve it? tips above didnt help
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pg_restore: [archiver] input file is too short (read 0, expected 5) error why ?