如何修改psql中报错提示的所用语言?

如何修改psql中报错提示的所用语言?

[root@yueqi ~]# su - highgo  
Last login: Mon Feb 12 10:58:18 CST 2018 on pts/1  
[highgo@yueqi ~]$ echo $LANG  
en_US.UTF-8  
[highgo@yueqi ~]$ locale  
LANG=en_US.UTF-8  
LC_CTYPE="en_US.UTF-8"  
LC_NUMERIC="en_US.UTF-8"  
LC_TIME="en_US.UTF-8"  
LC_COLLATE="en_US.UTF-8"  
LC_MONETARY="en_US.UTF-8"  
LC_MESSAGES="en_US.UTF-8"  
LC_PAPER="en_US.UTF-8"  
LC_NAME="en_US.UTF-8"  
LC_ADDRESS="en_US.UTF-8"  
LC_TELEPHONE="en_US.UTF-8"  
LC_MEASUREMENT="en_US.UTF-8"  
LC_IDENTIFICATION="en_US.UTF-8"  
LC_ALL=  
[highgo@yueqi ~]$ psql  
psql (4.1.1)  
  
PSQL: Release 4.1.1  
Connected to:  
HighGo Database V4.1 Enterprise Edition Release 4.1.1 - 64-bit Production  
  
Type "help" for help.  
  
highgo=# select * from sdfs;  
错误:  42P01: 关系 "sdfs" 不存在 。 ------>>>还是中文,说明跟$LANG没关系  
LINE 1: select * from sdfs;  
                      ^  
highgo=# \q  
[highgo@yueqi ~]$ psql  
psql (4.1.1)  
  
PSQL: Release 4.1.1  
Connected to:  
HighGo Database V4.1 Enterprise Edition Release 4.1.1 - 64-bit Production  
  
Type "help" for help.  
  
highgo=# show lc_m  
lc_messages  lc_monetary    
highgo=# show lc_messages ;  
 lc_messages   
-------------  
 zh_CN.utf8  
(1 row)  
  
highgo=# set lc_messages='en_US.UTF-8';  
SET  
highgo=# select * from sdfs;  
ERROR:  42P01: relation "sdfs" does not exist ---->>>报错变成英语了。  
LINE 1: select * from sdfs;  
                      ^  
highgo=#   
(0)
上一篇 2022年3月21日
下一篇 2022年3月21日

相关推荐