factor out searching for parent road for pois

This commit is contained in:
Sarah Hoffmann
2020-01-16 20:26:17 +01:00
parent cf4dbbd681
commit 1033f8bce7
2 changed files with 157 additions and 122 deletions

View File

@@ -253,6 +253,23 @@ $$
LANGUAGE plpgsql STABLE;
CREATE OR REPLACE FUNCTION word_ids_from_name(lookup_word TEXT)
RETURNS INTEGER[]
AS $$
DECLARE
lookup_token TEXT;
return_word_ids INTEGER[];
BEGIN
lookup_token := ' '|| make_standard_name(lookup_word);
SELECT array_agg(word_id) FROM word
WHERE word_token = lookup_token and class is null and type is null
INTO return_word_ids;
RETURN return_word_ids;
END;
$$
LANGUAGE plpgsql STABLE STRICT;
CREATE OR REPLACE FUNCTION create_country(src HSTORE, country_code varchar(2))
RETURNS VOID
AS $$