Replies: 4 comments 3 replies
-
How did you install Docker? ( |
Beta Was this translation helpful? Give feedback.
-
Hello, I don't know if it's a mistake, but doing these steps one fails and another one doesn't. `docker container run -d docker exec -it postgres1 psql -U usr -d postgres -c 'CREATE DATABASE "TEST";' docker container run -d docker exec -it postgres2 psql -U usr -d postgres -c 'CREATE DATABASE "TEST2";' Fail:docker exec -t postgres1 pg_dump -U usr -Fc -Z4 -Od TEST > TEST.dump Work:docker exec -it postgres1 bash ` Maybe it's not the postgres client, but the ">" redirection. Is it possible? libpq5:amd64 16.1-1.pgdg22.04+1 |
Beta Was this translation helpful? Give feedback.
-
I think I found the issue or at least the solution, and it's changing -t to -i in docker exec: docker exec -i postgres1 pg_dump -U usr -Fc -Z4 -Od TEST > TEST.dump It now works! Thanks! |
Beta Was this translation helpful? Give feedback.
-
Ah! Maybe the file was too big for a TTY |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
SO: Ubuntu 22.04 (32 GB RAM)
Install last client:
https://www.postgresql.org/download/linux/ubuntu/
Run a docker postgres:16
Backup from docker:
docker exec -t postgres pg_dump -U usr -Fc -Z4 -Od DATABASE > DATABASE.dump
Restore into docker with client:
pg_restore -vvv -U usr -h 127.0.0.1 -j 4 -Od TEST DATABASE.dump
Show errors and fail:
pg_restore: allocating AH for TEST.dump, format 0
pg_restore: attempting to ascertain archive format
pg_restore: conectando a la base de datos para reestablecimiento
pg_restore: asumiendo reestablecimiento de sólo datos
pg_restore: entering restore_toc_entries_prefork
pg_restore: entering restore_toc_entries_parallel
memoria agotada
But the backup is done with pg_dump from client it works (pg_dump from localhost, not docker):
pg_dump -U usr -h 127.0.0.1 -Fc -Z4 -Od DATABASE > DATABASE.dump
Beta Was this translation helpful? Give feedback.
All reactions