From 7391e00bc3b590bcf43a08421ee39c5f50a1b4dc Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 30 Mar 2012 00:52:08 +0200 Subject: [PATCH] postgresq 8.4 backward compatibility: count hash size with akeys instead of hash_to_array --- sql/functions.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5