无效的语言环境名称 Chinese (Simplified)_People''s Republic of China.936

pg9.6 或 pg10 在Windows Server 2012 R2 DataCenter 中使用。

使用如下建库语句,建库时

CREATE DATABASE upmap 
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'Chinese (Simplified)_People''s Republic of China.936'
LC_CTYPE = 'Chinese (Simplified)_People''s Republic of China.936'
TABLESPACE = up_map
CONNECTION LIMIT = -1;

出现如下错误:(无效的语言环境名称 Chinese (Simplified)_People''s Republic of China.936)

  

 

 

解决办法:

  1、查看  安装目录的\PostgreSQL\9.6\data  文件夹中的  postgresql.conf  文件中

  找到如下配置:

# These settings are initialized by initdb, but they can be changed.
lc_messages = 'Chinese (Simplified)_China.936'            # locale for system error message
                    # strings
lc_monetary = 'Chinese (Simplified)_China.936'            # locale for monetary formatting
lc_numeric = 'Chinese (Simplified)_China.936'            # locale for number formatting
lc_time = 'Chinese (Simplified)_China.936'                # locale for time formatting

 

  2、修改建库语句中的语言指定   

  将

    Chinese (Simplified)_People''s Republic of China.936

  修改为

    Chinese (Simplified)_China.936
CREATE DATABASE upmap    
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'Chinese (Simplified)_China.936'
LC_CTYPE = 'Chinese (Simplified)_China.936'
TABLESPACE = up_map
CONNECTION LIMIT = -1;

  

posted @ 2020-06-29 14:38  MobiusMap  阅读(5083)  评论(0编辑  收藏  举报