X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d6ff7475f1777f66cfc94847f6ba279fc0d10c2e..72193a1c2344ef541c14540da66c2b11ee1a9fe6:/sql/functions/normalization.sql

diff --git a/sql/functions/normalization.sql b/sql/functions/normalization.sql
index 1a8bbd84..08087172 100644
--- a/sql/functions/normalization.sql
+++ b/sql/functions/normalization.sql
@@ -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');
