PSQL Restore db file with xz

3.5k Views Asked by At

I created backup file psql.bak.xz of db, how to restore this file to db straight (without use unxz)?

I used this command to compress file:

pg_dump 2016 | xz > backups/psql.bak.xz

Thanks, Michael.

1

There are 1 best solutions below

1
On

You can just uncompress and pipe it to psql

xzcat backups/psql.bak.xz | psql db