Index: openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql,v
diff -u -r1.49 -r1.50
--- openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql	7 Aug 2017 23:47:56 -0000	1.49
+++ openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql	30 Apr 2018 14:02:27 -0000	1.50
@@ -465,9 +465,9 @@
   end if;
 
   if substring(p_tree_key, v_parent_pos, 1) = '1' then
-    return bittoint4(substring(p_tree_key, v_parent_pos + 1, 31));
+    return substring(p_tree_key, v_parent_pos + 1, 31)::bit(31)::integer;
   else
-    return bittoint4(substring(p_tree_key, v_parent_pos, 8));
+    return substring(p_tree_key, v_parent_pos, 8)::bit(8)::integer;
   end if;
 
 END;
@@ -555,9 +555,9 @@
   end loop;
 
   if substring(p_tree_key, v_leaf_pos, 1) = '1' then
-    return bittoint4(substring(p_tree_key, v_leaf_pos + 1, 31));
+    return substring(p_tree_key, v_leaf_pos + 1, 31)::bit(31)::integer;
   else
-    return bittoint4(substring(p_tree_key, v_leaf_pos, 8));
+    return substring(p_tree_key, v_leaf_pos, 8)::bit(8)::integer;
   end if;
 
 END;
