]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/setup.php
Merge branch 'master' of github.com:twain47/Nominatim
[nominatim.git] / utils / setup.php
index 1deb060a433cc6b8b8df9885ad2bb794a5ad732a..4de5953f7a0e935298e8d760e55ad00a83407be8 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'])
                {