Index: openacs-4/packages/acs-kernel/sql/postgresql/lob.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/lob.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-kernel/sql/postgresql/lob.sql	30 Mar 2001 03:15:14 -0000	1.1
+++ openacs-4/packages/acs-kernel/sql/postgresql/lob.sql	7 Apr 2001 15:54:55 -0000	1.2
@@ -100,6 +100,8 @@
         from_id         alias for $1;
         to_id           alias for $2;
 begin
+        insert into lobs (lob_id,refcount) values (to_id,0);
+
         insert into lob_data
              select to_id as lob_id, segment, byte_len, data
                from lob_data
@@ -108,3 +110,10 @@
         return null;
 
 end;' language 'plpgsql';
+
+create function lob_length(integer) returns integer as '
+declare
+        id  alias for $1;
+begin
+        return sum(byte_len) from lob_data where lob_id = id;
+end;' language 'plpgsql';
