Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-create.sql,v
diff -u -r1.53 -r1.53.2.1
--- openacs-4/packages/acs-content-repository/sql/postgresql/content-create.sql	29 Aug 2007 18:28:16 -0000	1.53
+++ openacs-4/packages/acs-content-repository/sql/postgresql/content-create.sql	25 Apr 2008 19:29:31 -0000	1.53.2.1
@@ -764,12 +764,8 @@
 
 create table cr_folders (
   folder_id	    integer
-  -- removed due to postgresql RI bug which causes deletion failures.
-  -- replace with user triggers
-  -- DanW (dcwickstrom@earthlink.net)
-
-  --		    constraint cr_folder_id_fk references
-  --		    cr_items on delete cascade
+		    constraint cr_folder_id_fk references
+		    cr_items on delete cascade
 		    constraint cr_folders_folder_id_pk 
                     primary key,
   label		    varchar(1000),
@@ -789,46 +785,6 @@
 --RI Indexes
 create index cr_folders_package_id_idx ON cr_folders(package_id);
 
-create function cr_folder_ins_up_ri_trg() returns opaque as '
-declare
-        dummy           integer;
-        v_latest        integer;
-        v_live          integer;
-begin
-        select 1 into dummy
-        from 
-          cr_items         
-        where 
-          item_id = new.folder_id;
-        
-        if NOT FOUND then
-          raise EXCEPTION ''Referential Integrity: folder_id does not exist in cr_items: %'', new.folder_id;
-        end if;
-
-        return new;
-end;' language 'plpgsql';
-
-create function cr_folder_del_ri_trg() returns opaque as '
-declare
-        dummy           integer;
-begin
-        delete from cr_folders where folder_id = old.item_id;          
-        return old;
-end;' language 'plpgsql';
-
--- reimplementation of RI triggers. (DanW dcwickstrom@earthlink.net)
-
-create trigger cr_folder_ins_up_ri_trg 
-before insert or update on cr_folders
-for each row execute procedure cr_folder_ins_up_ri_trg();
-
-create trigger cr_folder_del_ri_trg 
-before delete on cr_items
-for each row execute procedure cr_folder_del_ri_trg();
-
-
-
-
 create table cr_folder_type_map (
   folder_id	integer
 		constraint cr_folder_type_map_fldr_fk
