From 8e004dca446088ee06a65f0e18e277209eae7bb3 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 19 Aug 2012 23:08:51 +0200 Subject: [PATCH] make sure first of each address rank is used get_addressdata should not really return duplicates but if there are the first result will be the best one, so make sure that one is used --- sql/functions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/functions.sql b/sql/functions.sql index 548362ad..382cb003 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -2178,7 +2178,7 @@ BEGIN FOR location IN select * from get_addressdata(for_place_id) where isaddress order by rank_address desc LOOP currresult := trim(get_name_by_language(location.name, languagepref)); - IF currresult != prevresult AND currresult IS NOT NULL THEN + IF currresult != prevresult AND currresult IS NOT NULL AND result[(100 - location.rank_address)] IS NULL THEN result[(100 - location.rank_address)] := trim(get_name_by_language(location.name, languagepref)); prevresult := currresult; END IF; -- 2.39.5