2

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?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.