5

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.

Michael Horojanski
  • 4,543
  • 4
  • 33
  • 34

1 Answers1

9

You can just uncompress and pipe it to psql

xzcat backups/psql.bak.xz | psql db
Sami Kuhmonen
  • 30,146
  • 9
  • 61
  • 74