开发者

How to disable Postgresql messages translation

Is there a way to disable the Postgresql translation of messages? I´m running my appl and Postgresql on a pt_BR Windows machine and when a exception is thrown the error message is translated to Portuguese, like:

Caused by: org.postgresql.util.PSQLException: ERRO: relação "unidade_federaca开发者_运维问答o" não existe Posição: 25

I would like the messages to appear in English.

I´m using the driver postgresql-8.4-701.jdbc3.jar on a Java (with Hibernate) app.

thanks in advance, Fabrício Lemos


You could change lc_messages in postgresql.conf or just per database:

ALTER DATABASE dbname SET lc_messages=en_us;

See also the manual.


Under Windows, some psql error messages are getting translated corresponding to the format setting in Windows settings -> Clock, Language, and Region -> Change location -> Formats -> Format.

To prevent a mix of translated and untranslated messages, I've set this format to "English (United States)".


execute the following query to your database in order to find the postgres.conf file which is loaded for the configuration:

SHOW config_file;

Edit your postgres.conf file with your prefered lc.... lc_messages,lc_numeric...etc.

i think you can change all with lc_ALL example : lc_ALL=en_US.UTF-8

Finally execute the following command to reload conf.

SELECT pg_reload_conf();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜