3

I have a Postgres database dump in a .7z archive.

I can extract it and import it with:

7za e dump.7z dump
psql -h localhost db_name < dump

but I'm just running out of disk space.

What is the correct way to pipe the 7za output to psql, so that I don't have a large temporary file taking up space?

Liam
  • 3,150

2 Answers2

0

If it's similar to importing from a .gz file, then you're looking to pipe the output from 7za into psql with something like this:

7za e dump.7z | psql -h localhost db_name
0

Use the -so option for 7za.

7za e -so dump.7z | psql -h localhost -U admin db_name
Liam
  • 3,150