pgAdmin 不返回任何错误信息,总是报Successfully.

使用pgAdmin管理Postgresql遇到非常奇怪现象,任何sql语句运行时都不会报错,即使有非常明显的错误,总是报”successfully”,这个问题困扰了我两天,查了非常多的英文资料,最后总是验证了一个解决方法:
编辑 data目录下的 postgresql.conf文件,查找下面类似的行,修改本地语言设置:
lc_messages = 'English_United States.1252' 
    #这一句是关键
    #原来的值是:Chinese (Simplified)_China.936'        
    #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

最终验证的结论是,如果你按照postgresql时选择的默认本地语言是中文,100%会遇到这个问题,pgAdmin似乎不能正确处理Query返回的中文信息,把lc_messages改成英文,重启服务即可。

奇怪的是这个BUG似乎很少人遇到,Postgresql也没有及时进行处理!

这篇文章有 2 个评论

  1. 第 zoltun页

    被这坑惨了, 浪费了1个多小时才找出sql错在那里.

    1. 第 Emeric lee页

      我是花了半天时间才找到问题的症结…

发表评论