- IF for_place_id IS NULL THEN
- select coalesce(linked_place_id, place_id), country_code,
- housenumber, rank_search, postcode,
- address is not null and address ? 'postcode', null
- from placex where place_id = in_place_id
- INTO for_place_id, searchcountrycode, searchhousenumber, searchrankaddress, searchpostcode, postcode_isexact, searchhousename;
+ IF place IS NULL THEN
+ select coalesce(linked_place_id, place_id) as place_id, country_code,
+ housenumber, postcode,
+ class, type,
+ null::hstore as name, address,
+ null::geometry as centroid
+ INTO place
+ FROM placex where place_id = in_place_id;