1

试图找到从PostgreSQL 10.6到的迁移路线postgreSQL 11.1

使用pg_upgrade, 从两个版本中,给我错误。我认为从中11.1可以将过时的表格带入货币:

$ /usr/local/Cellar/postgresql/11.1/bin/pg_upgrade -v \
>     -b /usr/local/Cellar/postgresql@10/10.6/bin \
>     -B /usr/local/Cellar/postgresql/11.1/bin \
>     -d /usr/local/var/postgres \
>     -D /usr/local/var/postgres
Running in verbose mode
Performing Consistency Checks
-----------------------------
Checking cluster versions
This utility can only upgrade to PostgreSQL version 11.
Failure, exiting

10.6,预期结果,因为它看不到正向结构:

/usr/local/Cellar/postgresql@10/10.6/bin/pg_upgrade -v \
>     -b /usr/local/Cellar/postgresql@10/10.6/bin \
>     -B /usr/local/Cellar/postgresql/11.1/bin \
>     -d /usr/local/var/postgres \
>     -D /usr/local/var/postgres
Running in verbose mode
Performing Consistency Checks
-----------------------------
Checking cluster versions
New cluster data and binary directories are from different major versions.
Failure, exiting

如何迁移表以11.1正确使用版本?我假设后一个版本是要使用的版本,并且我的目录是有效的。

4

1 回答 1

2

是的,您需要使用升级到 (11.1) 版本的 pg_upgrade。

您的 -b 和 -B 选项看起来不错。但是,您的 -d 和 -D 不能相同!配置位置还定义了数据位置,它们不能相同。您需要使用 -D 指定初始化的 11.1 集群的配置位置。

如果您不希望 pg_upgrade 复制所有数据,请使用 --link 选项来使用硬链接而不是复制。升级后,您可以删除旧数据目录。

于 2018-12-29T09:05:05.523 回答