From: Sarah Hoffmann Date: Thu, 29 Mar 2012 22:52:08 +0000 (+0200) Subject: postgresq 8.4 backward compatibility: count hash size with akeys instead of hash_to_array X-Git-Tag: v2.0.0~95^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/7391e00bc3b590bcf43a08421ee39c5f50a1b4dc postgresq 8.4 backward compatibility: count hash size with akeys instead of hash_to_array --- diff --git a/sql/functions.sql b/sql/functions.sql index 59122efa..27fc6ae9 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -914,7 +914,7 @@ BEGIN NEW.geometry_sector := geometry_sector(NEW.partition, NEW.geometry); -- copy 'name' to or from the default language (if there is a default language) - IF NEW.name is not null AND array_upper(%#NEW.name,1) > 1 THEN + IF NEW.name is not null AND array_upper(akeys(NEW.name),1) > 1 THEN default_language := get_country_language_code(NEW.country_code); IF default_language IS NOT NULL THEN IF NEW.name ? 'name' AND NOT NEW.name ? ('name:'||default_language) THEN @@ -1260,7 +1260,7 @@ BEGIN -- Thought this wasn't needed but when we add new languages to the country_name table -- we need to update the existing names - IF NEW.name is not null AND array_upper(%#NEW.name,1) > 1 THEN + IF NEW.name is not null AND array_upper(akeys(NEW.name),1) > 1 THEN default_language := get_country_language_code(NEW.country_code); IF default_language IS NOT NULL THEN IF NEW.name ? 'name' AND NOT NEW.name ? ('name:'||default_language) THEN