PostgreSQL 10 => 11.1关于Brew更新问题 [英] PostgreSQL 10 => 11.1 on Brew Update Issues

查看:258
本文介绍了PostgreSQL 10 => 11.1关于Brew更新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Trying to find a migration route from PostgreSQL 10.6 to postgreSQL 11.1.

在两个版本中都使用 pg_upgrade 给我错误。从 11.1 起,我认为这将被用来将过时的表格转换为货币:

Using pg_upgrade, from both versions, give me errors. From 11.1 which I thought would be used to bring outdated tables to currency:

$ /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 的预期结果,因为它看不到前向结构:

From 10.6, the expected result, as it cannot see a forward structure:

/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

如何迁移表以与版本<$ c $一起使用c> 11.1 正确吗?我假设使用的是后者版本,并且我的目录有效。

How can I migrate the tables to work with version 11.1 properly? I am assuming the latter version is the one to use, and my directories are valid.

推荐答案

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

Yes you need to use pg_upgrade of the version you upgrade to (11.1).

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

Your -b and -B options look ok. Your -d and -D however cannot be the same! The config location also define the data locations and these cannot be the same. You need to specify the config location of your initialized 11.1 cluster with -D.

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

If you do not want pg_upgrade to copy all data use the --link option to use hard links instead of copying. After the upgrade you can remove old data dir.

这篇关于PostgreSQL 10 => 11.1关于Brew更新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆