]> git.openstreetmap.org Git - nominatim.git/commitdiff
truncate road partition tables during load
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Wed, 23 May 2012 23:42:59 +0000 (01:42 +0200)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Wed, 23 May 2012 23:42:59 +0000 (01:42 +0200)
utils/setup.php

index 9a238628e68522493383de8413e17620906388cd..c655eac053e11ecc0d4bff5df4e59b95b9a83f75 100755 (executable)
                if (!pg_query($oDB->connection, 'CREATE SEQUENCE seq_place start 100000')) fail(pg_last_error($oDB->connection));
                echo '.';
 
+               $sSQL = 'select partition from country_name order by country_code';
+               $aPartitions = $oDB->getCol($sSQL);
+               if (PEAR::isError($aPartitions))
+               {
+                       fail($aPartitions->getMessage());
+               }
+               $aPartitions[] = 0;
+               foreach($aPartitions as $sPartition)
+               {
+                       if (!pg_query($oDB->connection, 'TRUNCATE location_road_'.$sPartition)) fail(pg_last_error($oDB->connection));
+                       echo '.';
+               }
+
                // pre-create the word list
                if (!$aCMDResult['disable-token-precalc'])
                {