X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8e2ef2842ef6d854e87a27ff57043971765fdd8a..85530b3c52c2dc20cacb665c695402d2aa503954:/utils/setup.php?ds=sidebyside diff --git a/utils/setup.php b/utils/setup.php index 624c49a3..89177914 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -540,9 +540,10 @@ if ($aCMDResult['calculate-postcodes'] || $aCMDResult['all']) { $sSQL .= " FROM us_postcode WHERE postcode NOT IN"; $sSQL .= " (SELECT postcode FROM location_postcode"; $sSQL .= " WHERE country_code = 'us')"; - - if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection)); + } else { + $sSQL .= "TRUNCATE TABLE us_postcode"; } + if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection)); // add missing postcodes for GB (if available) $sSQL = "INSERT INTO location_postcode";