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 -N -r1.50 -r1.51
--- openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql	30 Apr 2018 14:02:27 -0000	1.50
+++ openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql	1 May 2018 10:43:05 -0000	1.51
@@ -347,7 +347,7 @@
 CREATE OR REPLACE FUNCTION inline_1(
 
 ) RETURNS integer AS $$
--- Create a bitfromint4(integer) function if it doesn't exists.
+-- Create a bittoint4(integer) function if it doesn't exists.
 -- This function is no longer present in 7.3 and above
 DECLARE
     v_bittoint4_count integer;
@@ -424,9 +424,9 @@
   end if;
 
   if p_intkey < 128 then
-    return substring(bitfromint4(p_intkey), 25, 8);
+    return substring(p_intkey::bit(32), 25, 8);
   else
-    return substring(bitfromint4(cast (-2^31 + p_intkey as int4)), 1, 32);
+    return substring((cast (-2^31 + p_intkey as int4))::bit(32), 1, 32);
   end if;
 
 END;
