]> git.openstreetmap.org Git - nominatim.git/commitdiff
force language of pgsql to C
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 29 Oct 2016 09:08:40 +0000 (11:08 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 15 Jan 2017 20:31:14 +0000 (21:31 +0100)
Fixes #558.

nominatim/index.c

index 90a3abea52a357ecac550daf4593a48c038e23a8..9aa3fb86c31ce0999d5aa22e6f0f83afa83dda53 100644 (file)
@@ -376,7 +376,7 @@ void nominatim_index(int rank_min, int rank_max, int num_threads, const char *co
                         1, pg_prepare_params);
         if (PQresultStatus(res) != PGRES_COMMAND_OK)
         {
-            fprintf(stderr, "Failed preparing index_placex: %s\n", PQerrorMessage(conn));
+            fprintf(stderr, "Failed preparing index_placex: %s\n", PQerrorMessage(thread_data[i].conn));
             exit(EXIT_FAILURE);
         }
         PQclear(res);
@@ -387,18 +387,19 @@ void nominatim_index(int rank_min, int rank_max, int num_threads, const char *co
                         1, pg_prepare_params);
         if (PQresultStatus(res) != PGRES_COMMAND_OK)
         {
-            fprintf(stderr, "Failed preparing index_osmline: %s\n", PQerrorMessage(conn));
+            fprintf(stderr, "Failed preparing index_osmline: %s\n", PQerrorMessage(thread_data[i].conn));
             exit(EXIT_FAILURE);
         }
         PQclear(res);
 
-        /*res = PQexec(thread_data[i].conn, "set enable_seqscan = false");
+        // Make sure the error message is not localized as we parse it later.
+        res = PQexec(thread_data[i].conn, "SET lc_messages TO 'C'");
         if (PQresultStatus(res) != PGRES_COMMAND_OK)
         {
-            fprintf(stderr, "Failed disabling sequential scan: %s\n", PQerrorMessage(conn));
+            fprintf(stderr, "Failed to set langauge: %s\n", PQerrorMessage(thread_data[i].conn));
             exit(EXIT_FAILURE);
         }
-        PQclear(res);*/
+        PQclear(res);
 
         nominatim_exportCreatePreparedQueries(thread_data[i].conn);
     }