+ nominatim_exportPlaceQueries(place_id, thread_data->conn, &querySet);
+ }
+
+ while(!done)
+ {
+ paramPlaceID = PGint64(place_id);
+ paramValues[0] = (char *)¶mPlaceID;
+ paramLengths[0] = sizeof(paramPlaceID);
+ paramFormats[0] = 1;
+ res = PQexecPrepared(thread_data->conn, "index_placex", 1, paramValues, paramLengths, paramFormats, 1);
+ if (PQresultStatus(res) == PGRES_COMMAND_OK)
+ done = 1;
+ else
+ {
+ if (!strncmp(PQerrorMessage(thread_data->conn), "ERROR: deadlock detected", 25))
+ {
+ fprintf(stderr, "index_placex: UPDATE failed - deadlock, retrying (%ld)\n", place_id);
+ PQclear(res);
+ sleep(rand() % 10);
+ }
+ else
+ {
+ fprintf(stderr, "index_placex: UPDATE failed: %s", PQerrorMessage(thread_data->conn));
+ PQclear(res);
+ exit(EXIT_FAILURE);
+ }
+ }