gpt4 book ai didi

database - Postgres 将数据库 "postgres"的编码从 10.4 升级到 11.5 与 : old "SQL_ASCII", 新 "UTF8"不匹配

转载 作者:行者123 更新时间:2023-12-02 09:47:18 24 4
gpt4 key购买 nike

目前正在检查将 Postgres 从 10.4 升级到 11.5 的过程。

当我跑 pg_upgrade使用“检查”选项,我收到以下消息。如果您对此有任何意见,关于您如何解决该问题,我将不胜感激。

bash-4.2$ /usr/pgsql-11/bin/pg_upgrade \
> -b /usr/pgsql-10/bin \
> -B /usr/pgsql-11/bin \
> -d /var/lib/pgsql/10/data \
> -D /var/lib/pgsql/11/data \
> -c pgsql-10/ pgsql-11/

Performing Consistency Checks on Old Live Server
------------------------------------------------
Checking cluster versions
ok
Checking database user is the install user
ok
Checking database connection settings
ok
Checking for prepared transactions
ok
Checking for reg* data types in user tables
ok
Checking for contrib/isn with bigint-passing mismatch
ok

encodings for database "postgres" do not match: old "SQL_ASCII", new "UTF8"
Failure, exiting

最佳答案

当您 initdb 新服务器时,您需要将其设置为与旧服务器匹配。类似于其中之一:

initdb --locale C  -D /var/lib/pgsql/11/data
pg_ctl initdb -o "--locale C" -D /var/lib/pgsql/11/data
LC_ALL=C initdb -D /var/lib/pgsql/11/data

关于database - Postgres 将数据库 "postgres"的编码从 10.4 升级到 11.5 与 : old "SQL_ASCII", 新 "UTF8"不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58512694/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com