【问题标题】:pg_restore: [archiver] input file does not appear to be a valid archive error in PostgreSQL using Pgadmin 4 in ubuntu 18.04pg_restore:在 ubuntu 18.04 中使用 Pgadmin 4 在 PostgreSQL 中,[archiver] 输入文件似乎不是有效的存档错误
【发布时间】:2019-06-08 12:03:50
【问题描述】:

我正在尝试在 postgresql 中恢复数据库的 sql 文件备份。它给了我以上错误。

我做了以下操作。

psql test </opt/backup.sql

和

pg_restore -U postgres -d test </opt/backup.sql

【问题讨论】:

    标签: django postgresql pg-restore


    【解决方案1】:

    你的备份出错了。

    尝试创建一个新的。使用有效的用户和数据库

    【讨论】:

    • 当我在 Mysql Workbench 中打开 sql 文件时,它正在工作。
    • postgresql 备份文件扩展名应该是 .pgsql 扩展名。像 backup.pgsql ,而不是 backup.sql
    • 如果您尝试任何其他数据库备份。它不适用于简单的导出命令
    • 但是在 windows 中,我在命令提示符下运行 pg_dump.exe -U postgres BPS_Server >"d:\backup.sql" 命令,它可以工作。
    • 尝试用 pg admin 导入
    猜你喜欢
    • 1970-01-01
    • 2021-06-02
    • 1970-01-01
    • 1970-01-01
    • 2023-01-31
    • 1970-01-01
    • 2016-07-27
    • 2018-08-28
    • 2020-06-08
    相关资源
    最近更新 更多