Index: openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl 29 Jun 2001 20:33:23 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl 14 Aug 2001 23:31:36 -0000 1.3 @@ -998,31 +998,36 @@ } } + ad_proc -private bboard_garbage_collect_postgresql {} { Works around postgresql bugs that make it impossible to delete multiple items in a single transaction WARNING The Postgres version of these queries - assume that acs-messaging is only used by bboard, - and will delete entries made by any other package. + assume that acs-messaging is only used by bboard + and general-comments, and will delete entries made + by any other package. If this poses a problem, revisit the oracle queries and port the CONNECT BY query faithfully. } { db_foreach get_orphans { select object_id as message_id from acs_objects where object_type = 'acs_message' - and object_id not in (select message_id - from bboard_forum_message_map) + and object_id not in (select message_id + from bboard_forum_message_map + union + select comment_id + from general_comments) } { - db_dml clear_revision_references { - update cr_items + db_dml clear_revision_references { + update cr_items set latest_revision=null, live_revision=null where item_id = :message_id - } + } - db_exec_plsql delete_message { - select bboard_message__remove(:message_id); - } + db_exec_plsql delete_message { + select bboard_message__remove(:message_id); + } } -} \ No newline at end of file +}