PostgreSQL logs messages in a different language than English

https://access.redhat.com/solutions/4369881
 SOLUTION 已验证 - 已更新 2019年八月23日22:54 - 

English 

环境

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6

问题

  • PostgreSQL logs messages in a different language than English.
  • PostgreSQL logs messages in local format, that is different from English.

决议

Change lc_ values in postgresql.conf to the default value of en_US.UTF-8 and restart PostgreSQL.

Raw

# grep lc_ /var/lib/pgsql/data/postgresql.conf 
lc_messages = 'en_US.UTF-8' # locale for system error message
lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
lc_numeric = 'en_US.UTF-8'  # locale for number formatting
lc_time = 'en_US.UTF-8'     # locale for time formatting

# systemctl restart postgresql.service

根源

To initialize a PostgreSQL database, initdb command has to be executed. This command uses local locale settings to configure the database. If local locale is set to other language than English, and if PostgreSQL has been translated to that language, messages will be logged in that other language.

initdb accepts locale parameter to initialize the database with a locale different to the system's one.

Raw

# initdb --locale en_US.UTF-8

诊断步骤

Check lc_ settings in postgresql.conf.

Raw

# grep lc_ /var/lib/pgsql/data/postgresql.conf 
lc_messages = 'es_ES.utf8' # locale for system error message
lc_monetary = 'es_ES.utf8' # locale for monetary formatting
lc_numeric = 'es_ES.utf8'  # locale for number formatting
lc_time = 'es_ES.utf8'     # locale for time formatting
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值