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

前端之家收集整理的这篇文章主要介绍了使用不同的语言环境连接到postgresql数据库前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一些我需要连接的旧数据库(postgres 9.1).我没有问题启动服务器
  1. pg_ctl start -D D:\datadir\pgdata\data -w

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

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

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

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

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

我用它解决

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

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

之后重启postgresql服务.

猜你在找的Postgre SQL相关文章