Use place instead of placex to compute postcodes

This commit is contained in:
AntoJvlt
2021-06-04 21:26:13 +02:00
committed by root
parent 38fbc4fcbb
commit a4733eed90
4 changed files with 43 additions and 19 deletions

View File

@@ -77,6 +77,12 @@ BEGIN
ELSE -- insert to placex
-- Pure postcodes are never queried from placex so we don't add them.
-- location_postcodes is filled from the place table directly.
IF NEW.class = 'place' AND NEW.type = 'postcode' THEN
RETURN NEW;
END IF;
-- Patch in additional country names
IF NEW.admin_level = 2 AND NEW.type = 'administrative'
AND NEW.address is not NULL AND NEW.address ? 'country' THEN