将错误消息设置为英语不起作用

时间:2016-01-06 18:30:31

标签: postgresql

由于某种原因,我无法更改PostgreSQL中错误消息的语言。我试图在脚本中设置语言,以便在第一行创建模式:

SET lc_messages TO 'en_US.UTF-8';

我也做了this,将LC_MESSAGES设置为English,但没有帮助。是的,我在更改值后重新启动了服务。

enter image description here

似乎没什么用。我仍然用德语发信息。

我还可以尝试吗?

2 个答案:

答案 0 :(得分:3)

如果您有权访问$ datadir \ postgresql.conf,则将lc_messages参数更改为“English_United States.1252”。

必须重新加载配置后。

我的配置设置在这里;

  

#这些设置由initdb初始化,但可以更改。

     

lc_messages ='English_United States.1252'#locale for system error message strings

     

lc_monetary ='English_United States.1252'货币格式的区域设置

     

lc_numeric ='English_United States.1252'#locale for number formatting

     

lc_time ='English_United States.1252'#locale for time formatting

     

#文本搜索的默认配置

     

default_text_search_config ='pg_catalog.english'

答案 1 :(得分:0)

您是否尝试过以下命令?

initdb --locale=en_US --lc_messages=en_US

有关详细信息,请参阅http://www.postgresql.org/docs/9.0/static/locale.html