Postgres 从 10.4 升级到 11.5 数据库“postgres”的编码不匹配:旧的“SQL_ASCII”,新的“UTF8”

car*_*ero 6 database postgresql encoding upgrade

目前正在检查将 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
Run Code Online (Sandbox Code Playgroud)

car*_*ero 1

@jjanes,Laurenz Albe 感谢您的评论,我第一次不明白,根据文档我试图执行以下命令:#/usr/pgsql-11/bin/postgresql-11-setup initdb --locale=C -D /var/lib/pgsql/11/data
但它正在下降,然后我按照您的建议执行了命令并且验证已成功:/usr/pgsql-11/bin/initdb --locale=C -D /var/lib/pgsql/11/data

-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
Checking for presence of required libraries                 ok
Checking database user is the install user                  ok
Checking for prepared transactions                          ok

*Clusters are compatible*
Run Code Online (Sandbox Code Playgroud)

现在,我有第二个问题是否可以更改源 postgres 数据库的编码?如果我决定只避免这种情况并继续默认使用 SQL_ASCII,它会以何种方式影响?