X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/71e6d5f9a675d3bcd997f39afec5e6e9f131e708..4c7145c2938022d8355f49eb89a5ae1a68217a18:/utils/setup.php diff --git a/utils/setup.php b/utils/setup.php index fae200cc..6a809c73 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -360,13 +360,13 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) { } echo "Load Data\n"; + $sColumns = 'osm_type, osm_id, class, type, name, admin_level, address, extratags, geometry'; + $aDBInstances = array(); $iLoadThreads = max(1, $iInstances - 1); for ($i = 0; $i < $iLoadThreads; $i++) { $aDBInstances[$i] =& getDB(true); - $sSQL = 'insert into placex (osm_type, osm_id, class, type, name, admin_level, '; - $sSQL .= ' address, extratags, geometry) '; - $sSQL .= 'select * from place where osm_id % '.$iLoadThreads.' = '.$i; + $sSQL = "INSERT INTO placex ($sColumns) SELECT $sColumns FROM place WHERE osm_id % $iLoadThreads = $i"; $sSQL .= " and not (class='place' and type='houses' and osm_type='W' and ST_GeometryType(geometry) = 'ST_LineString')"; if ($aCMDResult['verbose']) echo "$sSQL\n"; if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) {