From a32fe96e168fcd5594525b054a625f12a1b61f63 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Thu, 24 May 2012 01:42:59 +0200 Subject: [PATCH] truncate road partition tables during load --- utils/setup.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/setup.php b/utils/setup.php index 9a238628..c655eac0 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -270,6 +270,19 @@ 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']) { -- 2.39.5