简体   繁体   中英

pg_restore: error: input file does not appear to be a valid archive

I've extracted a pg_dump, but I'm not 100% sure on what I should name my output file. Here is my command:

pg_dump --dbname=db --format=t --host=foo --username=db --password=bar --dbname=db --exclude-table=store > db_backup

This gets my a nice file, 120megs, as I'd expect. When I try to do pg_restore in PG admin, I get:

pg_restore: error: input file does not appear to be a valid archive

The command pgdmin is running is like this:

pg_restore.exe --host "localhost" --port "5432" --username "foo" --no-password --role "yanis" --dbname "air" --verbose

Please make sure that in pgadmin restore window you are passing the full path including the file name. Pgdmin will create a command something like this:

pg_restore.exe --host "localhost" --port "5432" --username "foo" --no-password --role "yanis" --dbname "air" --verbose "C:/db_backup"

Also, make sure that pgadmin can read db_backup file and the permission on file is not restricted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM