Index: openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-4.1.2-4.5.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-4.1.2-4.5.sql,v
diff -u -N
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-4.1.2-4.5.sql	15 May 2002 22:27:15 -0000	1.1.2.1
@@ -0,0 +1,26 @@
+-- packages/acs-content-repository/sql/upgrade/upgrade-4.1.2-4.5.sql
+--
+-- @author vinod@kurup.com
+-- @creation-date 2002-05-15
+-- @cvs-id $Id: upgrade-4.1.2-4.5.sql,v 1.1.2.1 2002/05/15 22:27:15 vinodk Exp $
+--
+
+-- fixes bug #1502 http://openacs.org/sdm/one-baf.tcl?baf_id=1502
+
+drop function content_keyword__delete(integer);
+create function content_keyword__delete (integer)
+returns integer as '
+declare
+  delete__keyword_id             alias for $1;  
+  v_rec                          record; 
+begin
+
+  for v_rec in select item_id from cr_item_keyword_map 
+    where keyword_id = delete__keyword_id LOOP
+    PERFORM content_keyword__item_unassign(v_rec.item_id, delete__keyword_id);
+  end LOOP;
+
+  PERFORM acs_object__delete(delete__keyword_id);
+
+  return 0; 
+end;' language 'plpgsql';
