]> git.openstreetmap.org Git - nominatim.git/blobdiff - sql/functions/normalization.sql
Merge pull request #1960 from lonvia/fix-postcodes-duplicated-by-normalization
[nominatim.git] / sql / functions / normalization.sql
index 1a8bbd84412d8fdb09d3f8291c6b13983afde61e..08087172c578f72186620b1b1fe859773bec2617 100644 (file)
@@ -81,7 +81,8 @@ BEGIN
   lookup_word := upper(trim(postcode));
   lookup_token := ' ' || make_standard_name(lookup_word);
   SELECT min(word_id) FROM word
-    WHERE word_token = lookup_token and class='place' and type='postcode'
+    WHERE word_token = lookup_token and word = lookup_word
+          and class='place' and type='postcode'
     INTO return_word_id;
   IF return_word_id IS NULL THEN
     return_word_id := nextval('seq_word');