# HG changeset patch # User Julien Cristau # Date 1454680103 -3600 # Node ID b288debc6736db78538c917fb3589c77508871c0 # Parent 518eb10adcd50a2893d519b6a8b9fb782059f4c2 [server] explicitly set postgres LC_MESSAGES variable to C on connection We parse some error messages so we need them to be in English. It's not clear to me exactly when that's not the case, but this fixes running unittest_postgres' "test_constraint_validationerror" with py.test for Sylvain. diff -r 518eb10adcd5 -r b288debc6736 cubicweb/server/sqlutils.py --- a/cubicweb/server/sqlutils.py Thu Mar 19 21:19:52 2015 +0100 +++ b/cubicweb/server/sqlutils.py Fri Feb 05 14:48:23 2016 +0100 @@ -584,6 +584,7 @@ def _init_postgres_connection(cnx): """Internal function that will be called to init a postgresql connection""" cnx.cursor().execute('SET TIME ZONE UTC') + cnx.cursor().execute("SET lc_messages to 'C'") # commit is needed, else setting are lost if the connection is first # rolled back cnx.commit()