繁体   English   中英

无法在Postgresql-10.0上还原数据库备份

[英]Unable to restore database backup on Postgresql-10.0

我在Linux机器(RHEL 7.4)上使用了postgresql-9.4(端口5432)和postgresql-10.0(端口5433)。 使用yum存储库安装了Postgresql-9.4,使用源在不同分区中安装了Postgresql-10.0。

我已经使用它的pg_dump在Postgresql-9.4上备份了数据库(dtbase.backup),并尝试使用它的pg_restore在Postgresql-10.0上恢复了它。

在执行此操作时,出现以下错误:

pg_restore: [archiver] unsupported version (1.13) in file header

我已经检查了不同的论坛,但找不到解决方案。 任何帮助将不胜感激。

您必须将PostgreSQL v10升级到10.3,以便提交b8a2908f0ac735da68d49be2bce2d523e363f67b

Avoid using unsafe search_path settings during dump and restore.

Historically, pg_dump has "set search_path = foo, pg_catalog" when
dumping an object in schema "foo", and has also caused that setting
to be used while restoring the object.  This is problematic because
functions and operators in schema "foo" could capture references meant
to refer to pg_catalog entries, both in the queries issued by pg_dump
and those issued during the subsequent restore run.  That could
result in dump/restore misbehavior, or in privilege escalation if a
nefarious user installs trojan-horse functions or operators.

This patch changes pg_dump so that it does not change the search_path
dynamically.  The emitted restore script sets the search_path to what
was used at dump time, and then leaves it alone thereafter.  Created
objects are placed in the correct schema, regardless of the active
search_path, by dint of schema-qualifying their names in the CREATE
commands, as well as in subsequent ALTER and ALTER-like commands.

Since this change requires a change in the behavior of pg_restore
when processing an archive file made according to this new convention,
bump the archive file version number; old versions of pg_restore will
therefore refuse to process files made with new versions of pg_dump.

Security: CVE-2018-1058

您的9.4安装已使用存档格式1.13,而您的v10安装尚不了解。

此外,您应始终使用PostgreSQL更高版本中的pg_dump升级数据库。

暂无
暂无

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

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