[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.
--- 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()