Michael Horojanski
Michael Horojanski

Reputation: 4701

PSQL Restore db file with xz

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.

Upvotes: 5

Views: 3770

Answers (1)

Sami Kuhmonen
Sami Kuhmonen

Reputation: 31143

You can just uncompress and pipe it to psql

xzcat backups/psql.bak.xz | psql db

Upvotes: 10

Related Questions