From: Sarah Hoffmann Date: Sun, 2 Jul 2017 09:32:32 +0000 (+0200) Subject: normalize postcodes before adding to location tables X-Git-Tag: v3.1.0~88^2~32 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/dc2911ae7257b0b1d95eec922e17361a458d213f?ds=inline normalize postcodes before adding to location tables --- diff --git a/sql/functions.sql b/sql/functions.sql index 44918774..1940ea75 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -617,10 +617,9 @@ BEGIN x := deleteLocationArea(partition, place_id, rank_search); -- add postcode only if it contains a single entry, i.e. ignore postcode lists - IF in_postcode IS NULL OR in_postcode similar to '%(,|;)%' THEN - postcode := NULL; - ELSE - postcode := in_postcode; + postcode := NULL; + IF in_postcode is not null AND in_postcode not similar to '%(,|;)%' THEN + postcode := upper(trim (both ' ' from in_postcode)); END IF; IF ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') THEN