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

使用不同的语言环境连接到postgresql数据库

发布时间:2020-12-13 16:16:58 所属栏目:百科 来源:网络整理
导读:我有一些我需要连接的旧数据库(postgres 9.1).我没有问题启动服务器 pg_ctl start -D D:datadirpgdatadata -w 但是当我尝试连接时,它会给出: psql -U postgres -p 15432psql: FATAL: database locale is incompatible with operating systemDETAIL: The
我有一些我需要连接的旧数据库(postgres 9.1).我没有问题启动服务器
pg_ctl start -D D:datadirpgdatadata -w

但是当我尝试连接时,它会给出:

psql -U postgres -p 15432
psql: FATAL:  database locale is incompatible with operating system
DETAIL:  The database was initialized with LC_COLLATE "Norwegian (Bokm?l)_Norway.1252",which is not recognized by setlocale().
HINT:  Recreate the database with another locale or install the missing locale.

新版本的postgres无法启动服务器(不兼容的数据版本).
我正在使用windows 10,使用postgres 9.1二进制文件.

如何连接,迁移,升级此类数据库以访问其数据?

我今天遇到了这个问题.除了我的错误是en_GB:
The database was initialized with LC_COLLATE "en_GB.UTF-8",which is not recognized by setlocale().

我用它解决了

localedef -f UTF-8 -i en_GB en_GB.UTF-8

您需要根据语言设置进行更改.

之后重启postgresql服务.

(编辑:李大同)

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

    推荐文章
      热点阅读