简体   繁体   English

pg_restore:[存档]输入文件在使用Pgadmin 4的PostgreSQL中似乎不是有效的存档错误

[英]pg_restore: [archiver] input file does not appear to be a valid archive error in PostgreSQL using Pgadmin 4

I am trying to open a SQL Script of PostgreSQL (.sql file) that contains the Create Database and INSERT statements but when I try to restore the database using PgAdmin 4 it gives me error stating "pg_restore: [archiver] input file does not appear to be a valid archive" . 我正在尝试打开包含创建数据库和INSERT语句的PostgreSQL(.sql文件)的SQL脚本,但是当我尝试使用PgAdmin 4还原数据库时,出现错误,提示“ pg_restore:[archiver]输入文件未出现成为有效的档案”。 I selected the following fields in the Restore Database dialog box: 我在“还原数据库”对话框中选择了以下字段:

Format - as Custom or tar 格式 -自定义或tar

Filename - C:\\Users\\parwa\\Desktop\\DWBI\\Assignment - 2(Chinook SQL - 2)\\Question Content\\Chinook_PostgreSql.sql 文件名 -C:\\ Users \\ parwa \\ Desktop \\ DWBI \\ Assignment-2(Chinook SQL-2)\\问题内容\\ Chinook_PostgreSql.sql

Number of Jobs - (left this field blank) 职位数量 -(此字段留空)

Role name - Postgres 角色名称 -Postgres

I am not sure why it's giving me this error. 我不确定为什么会给我这个错误。 Any help regarding this will be greatly appreciated. 任何与此有关的帮助将不胜感激。 Thanks! 谢谢!

In pgAdmin 4 the Restore Dialog is a UI interface to the pg_restore command line utility ( https://www.postgresql.org/docs/9.2/static/app-pgrestore.html ), I don't think it deals with sql files directly. 在pgAdmin 4中,“还原对话框”是pg_restore命令行实用程序( https://www.postgresql.org/docs/9.2/static/app-pgrestore.html )的UI界面,我认为它不处理sql文件直。

The documentation says 该文件说

You can use the Query Tool to play back the script created during a plain-text backup made with the Backup dialog. 您可以使用查询工具来播放在使用“备份”对话框进行的纯文本备份期间创建的脚本。 For more information about backing up or restoring, please refer to the documentation for pg_dump or pg_restore. 有关备份或还原的更多信息,请参阅pg_dump或pg_restore的文档。

Which indicates that to restore the sql file you have you need to use the Query Tool instead. 这表明要恢复您拥有的sql文件,您需要使用查询工具。

Tools -> Query Tool and you can open or paste the file in there and run it. 工具->查询工具,您可以在其中打开或粘贴文件并运行它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pg_restore:[archiver]输入文件在ubuntu 18.04中使用Pgadmin 4的PostgreSQL中似乎不是有效的存档错误 - pg_restore: [archiver] input file does not appear to be a valid archive error in PostgreSQL using Pgadmin 4 in ubuntu 18.04 pg_restore:错误:输入文件似乎不是有效的存档 - pg_restore: error: input file does not appear to be a valid archive Postgres 教程:pg_restore:[archiver] 输入文件似乎不是有效的存档 - Postgres Tutorial: pg_restore: [archiver] input file does not appear to be a valid archive pg_restore: [archiver] postgres 中的输入文件太短错误 - pg_restore: [archiver] input file is too short error in postgres pg_restore:[tar archiver] 在 tar 存档中找不到文件“toc.dat”的 header:- [PostgreSQL-11] pg admin 4 - pg_restore: [tar archiver] could not find header for file "toc.dat" in tar archive :- [PostgreSQL-11] pg admin 4 pg_restore: [目录归档程序] 无法打开输入文件。 尝试恢复数据库时出错 - pg_restore: [directory archiver] could not open input file. Error while trying to restore DB pg_restore错误:pg_restore:文件头中的[archiver]不支持的版本(1.13) - pg_restore error: pg_restore: [archiver] unsupported version (1.13) in file header 来自pgadmin3的pg_restore错误 - Postgresql - pg_restore error from pgadmin3 - Postgresql pg_restore: [archiver] 文件头中不受支持的版本 (1.13) - pg_restore: [archiver] unsupported version (1.13) in file header pg_restore: [archiver] 文件头中不支持的版本 (1.14) - pg_restore: [archiver] unsupported version (1.14) in file header
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM