I have a 15 GB compressed PostgreSQL dump (as a pgbackup), that when extracted is closer to 60 GB. I have a cloud server with only 69 GB of free space (54 GB after the pgbackup is copied onto the box), and I was wondering if there was a cunning way that I could split the pgbackup into lots of smaller compressed pgbbackup files, delete the original large pgbackup and then iterate over the smaller pgbackups, decompressing, executing them and then deleting them, so that I can end up with the entire dataset in a PostgreSQL database given the disk constraints.
Here is a bunch of possible workarounds. Chose one meeting your requirements.
The answer is quite simple - use a pipe:
This way you don't need additional disk space for extracting the compressed dump file.
via stdin and ssh
If you run to low of disk space to copy the compressed dump file to the server use
pg_restore via network
Also an alternative is to reconfigure your postgreSQL database to allow the connection from your local workstation.
In this case you may use
splitting the dump