Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • this approach, unlike the accepted one, helped me to get correct encodings when doing this in Windows. (Actually, I applied the dump by going cat /home/db.sql | psql -U postgres -d DB_NAME -p DB_PORT) Commented Sep 16, 2021 at 7:28
  • This works much faster. One could make a backupscript based on this, build an image with the script included, and fire the script from the host through a cronjob. Mount a host-volume onto the container, and have a backupserver pull the daily sql-dumps. Commented Oct 6, 2021 at 10:43
  • I appreciate this because I had the exact same problem with cat db.dum |... Commented Jan 9, 2022 at 15:13
  • this is should be the correct answer, I mean why we need to pipe out the dumb file with cat idk Commented Jul 17, 2024 at 19:50