将PostgreSQL服务器错误消息的语言更改为英语

abd*_*men 7 postgresql

我的MS Windows系统是法语版.我最近安装了PostgreSQL服务器.虽然pgAdmin是英文的,但我在PostgreSQL psql命令行中获得了法语消息.

小智 14

如果您有权访问$datadir\postgresql.conf更改lc_messages参数English_United States.1252.您需要重新加载配置(重新启动服务器).

我的配置是:

# These settings are initialized by initdb, but they can be changed.
lc_messages = 'English_United States.1252'  # locale for system error message

# strings
lc_monetary = 'English_United States.1252'  # locale for monetary formatting
lc_numeric = 'English_United States.1252'   # locale for number formatting
lc_time = 'English_United States.1252'      # locale for time formatting

# default configuration for text search
default_text_search_config = 'pg_catalog.english'
Run Code Online (Sandbox Code Playgroud)

  • 这是对我有用的解决方案,谢谢。另一篇文章中提到的“环境变量”不起作用。以防其他人想知道:在我的情况下,`postgresql.conf` 文件位于 `C:\Program Files\PostgreSQL\9.5\data\postgresql.conf` 下。 (3认同)

a_h*_*ame 11

您需要定义一个名为的环境变量LC_MESSAGES并将其设置为English

在此输入图像描述