Skip to content

pg_restore: [archiver] input file does not appear to be a valid archive

pg_restore: [archiver] input file does not appear to be a valid archive

Category
Linux
On this page

If you are getting above error while restoring backup of database in postgresql. This error means you have taken backup in plain text format.

Error:

pg_restore: [archiver] input file does not appear to be a valid archive

Solution:

To restore plain text backup using below command.

Backup filename: backup-db.txt
Database name: mydb

# cat backup-db.txt | psql mydb

I hope it will help you.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

3 Comments

  1. Why do you assume it is in Linux? What if this problem is coming on Windows? “cat” is not a Windows command.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top