X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8e2ef2842ef6d854e87a27ff57043971765fdd8a..1424e8e29bd54d3f713a38a834ff0c8ff5f463fb:/utils/setup.php 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";