From 0ab547793d51e68345537b4c12dccc75d8b95450 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 26 May 2014 22:42:03 +0200 Subject: [PATCH 1/1] inherit postcode from street to poi --- sql/functions.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/functions.sql b/sql/functions.sql index 1da46920..e0f6de72 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -2487,7 +2487,7 @@ BEGIN CASE WHEN class = 'place' and type = 'postcode' THEN hstore('name', postcode) ELSE name END as name, class, type, admin_level, true as fromarea, true as isaddress, CASE WHEN rank_address = 0 THEN 100 WHEN rank_address = 11 THEN 5 ELSE rank_address END as rank_address, - 0 as distance, calculated_country_code + 0 as distance, calculated_country_code, postcode from placex where place_id = for_place_id LOOP @@ -2498,6 +2498,9 @@ BEGIN IF searchpostcode IS NOT NULL and location.type = 'postcode' THEN location.isaddress := FALSE; END IF; + IF searchpostcode IS NULL and location.postcode IS NOT NULL THEN + searchpostcode := location.postcode; + END IF; IF location.rank_address = 4 AND location.isaddress THEN hadcountry := true; END IF; -- 2.39.5