加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 为什么这个postgres数据库升级失败?

发布时间:2020-12-13 16:07:35 所属栏目:百科 来源:网络整理
导读:我试图从 Postgresql 9.6升级到10失败. 我成功运行了brew升级postgresql,然后使用失败消息运行brew postgresql-upgrade-database.问题似乎是这一行: 数据库“postgres”的lc_collat??e值不匹配:old“en_GB.UTF-8”,new“en_US.UTF-8” 整个信息是: == Upg
我试图从 Postgresql 9.6升级到10失败.

我成功运行了brew升级postgresql,然后使用失败消息运行brew postgresql-upgrade-database.问题似乎是这一行:

数据库“postgres”的lc_collat??e值不匹配:old“en_GB.UTF-8”,new“en_US.UTF-8”

整个信息是:

==> Upgrading postgresql data from 9.6 to 10...
Stopping `postgresql`... (might take a while)
==> Successfully stopped `postgresql` (label: homebrew.mxcl.postgresql)
==> Moving postgresql data from /usr/local/var/postgres to /usr/local/var/postgres.o
The files belonging to this database system will be owned by user "jbkimac".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /usr/local/var/postgres ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A,or
--auth-local and --auth-host,the next time you run initdb.

Success. You can now start the database server using:

    /usr/local/opt/postgresql/bin/pg_ctl -D /usr/local/var/postgres -l logfile start

Performing Consistency Checks
-----------------------------
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 invalid "unknown" user columns                 ok
Creating dump of global objects                             ok
Creating dump of database schemas
                                                            ok

lc_collate values for database "postgres" do not match:  old "en_GB.UTF-8",new "en_US.UTF-8"
Failure,exiting
Error: Upgrading postgresql data from 9.6 to 10 failed!
==> Removing empty postgresql initdb database...
==> Moving postgresql data back from /usr/local/var/postgres.old to /usr/local/var/p
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
Error: Failure while executing; `/usr/local/opt/postgresql/bin/pg_upgrade -r -b /usr/local/Cellar/postgresql/9.6.1/bin -B /usr/local/opt/postgresql/bin -d /usr/local/var/postgres.old -D /usr/local/var/postgres -j 8` exited with 1.

任何人都可以帮助建议我如何解决这个“en_GB.UTF-8”,新的“en_US.UTF-8”冲突问题?

解决方法

我遇到了与post postgresql-upgrade-database相同的问题,并且必须更改/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/cmd/brew-postgresql-upgrade-database.rb,如@Thermatix所述. -lc-collat??e和-lc-ctype都必须与当前数据库设置相对应.在我的情况下,两者都是ch_DE.UTF8.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读