无法在Postgresql-10.0

时间:2018-05-03 11:34:02

标签: linux postgresql pg-restore

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

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

执行此操作时,我收到以下错误:

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

我检查了不同的论坛但无法找到解决方案。任何帮助都将受到高度赞赏。

1 个答案:

答案 0 :(得分:2)

您必须将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来升级数据库。