truncate road partition tables during load

This commit is contained in:
Brian Quinion
2012-05-24 01:42:59 +02:00
parent 3af2a44a3c
commit a32fe96e16

View File

@@ -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'])
{