From 5ec25122f64523509b0cbc804c1be1f5f215c45c Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 23 Jan 2020 22:24:41 +0100 Subject: [PATCH] rename functions where return parameter changed Postgresql cannot cleanly reimport these functions when upgrading, so simply rename to avoid errors. --- sql/functions/aux_property.sql | 2 +- sql/functions/utils.sql | 4 ++-- sql/partition-functions.src.sql | 4 ++-- sql/tiger_import_start.sql | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/functions/aux_property.sql b/sql/functions/aux_property.sql index 841f240a..cee5cfb2 100644 --- a/sql/functions/aux_property.sql +++ b/sql/functions/aux_property.sql @@ -23,7 +23,7 @@ BEGIN address_street_word_ids := word_ids_from_name(in_street); IF address_street_word_ids IS NOT NULL THEN - out_parent_place_id := getNearestNamedRoadFeature(out_partition, place_centroid, + out_parent_place_id := getNearestNamedRoadPlaceId(out_partition, place_centroid, address_street_word_ids); END IF; diff --git a/sql/functions/utils.sql b/sql/functions/utils.sql index 741a3969..6371e9ad 100644 --- a/sql/functions/utils.sql +++ b/sql/functions/utils.sql @@ -262,7 +262,7 @@ BEGIN -- Note that addr:street links can only be indexed, once the street itself is indexed word_ids := word_ids_from_name(street); IF word_ids is not null THEN - parent_place_id := getNearestNamedRoadFeature(partition, centroid, word_ids); + parent_place_id := getNearestNamedRoadPlaceId(partition, centroid, word_ids); IF parent_place_id is not null THEN --DEBUG: RAISE WARNING 'Get parent form addr:street: %', parent.place_id; RETURN parent_place_id; @@ -274,7 +274,7 @@ BEGIN IF place is not null THEN word_ids := word_ids_from_name(place); IF word_ids is not null THEN - parent_place_id := getNearestNamedPlaceFeature(partition, centroid, word_ids); + parent_place_id := getNearestNamedPlacePlaceId(partition, centroid, word_ids); IF parent_place_id is not null THEN --DEBUG: RAISE WARNING 'Get parent form addr:place: %', parent.place_id; RETURN parent_place_id; diff --git a/sql/partition-functions.src.sql b/sql/partition-functions.src.sql index 50f50db4..41758c83 100644 --- a/sql/partition-functions.src.sql +++ b/sql/partition-functions.src.sql @@ -82,7 +82,7 @@ END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION getNearestNamedRoadFeature(in_partition INTEGER, +CREATE OR REPLACE FUNCTION getNearestNamedRoadPlaceId(in_partition INTEGER, point GEOMETRY, isin_token INTEGER[]) RETURNS BIGINT @@ -108,7 +108,7 @@ END $$ LANGUAGE plpgsql STABLE; -CREATE OR REPLACE FUNCTION getNearestNamedPlaceFeature(in_partition INTEGER, +CREATE OR REPLACE FUNCTION getNearestNamedPlacePlaceId(in_partition INTEGER, point GEOMETRY, isin_token INTEGER[]) RETURNS BIGINT diff --git a/sql/tiger_import_start.sql b/sql/tiger_import_start.sql index c5246854..b9c4fcfc 100644 --- a/sql/tiger_import_start.sql +++ b/sql/tiger_import_start.sql @@ -58,7 +58,7 @@ BEGIN address_street_word_ids := word_ids_from_name(in_street); IF address_street_word_ids IS NOT NULL THEN - out_parent_place_id := getNearestNamedRoadFeature(out_partition, place_centroid, + out_parent_place_id := getNearestNamedRoadPlaceId(out_partition, place_centroid, address_street_word_ids); END IF;