Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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_federacao" 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

like image 403
Fabricio Lemos Avatar asked Mar 08 '10 19:03

Fabricio Lemos


2 Answers

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

ALTER DATABASE dbname SET lc_messages=en_us;

See also the manual.

like image 122
Frank Heikens Avatar answered Nov 17 '22 08:11

Frank Heikens


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)".

like image 43
Hartmut Pfarr Avatar answered Nov 17 '22 10:11

Hartmut Pfarr