[英]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.