Index: openacs-4/packages/forums/lib/message/thread-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/thread-chunk-postgresql.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/forums/lib/message/thread-chunk-postgresql.xql 22 Jun 2004 16:53:41 -0000 1.1.2.1 +++ openacs-4/packages/forums/lib/message/thread-chunk-postgresql.xql 28 Jan 2005 16:12:51 -0000 1.1.2.2 @@ -5,13 +5,12 @@ - select fma.message_id - from forums_messages fm, - forums_messages_approved fma - where fm.message_id = :root_message_id - and fma.forum_id = :forum_id - and fma.tree_sortkey between fm.tree_sortkey and tree_right(fm.tree_sortkey) - order by fma.message_id + SELECT fma.message_id + FROM forums_messages_approved fma + WHERE fma.forum_id = :forum_id + and fma.tree_sortkey between (select fm.tree_sortkey from forums_messages fm where fm.message_id = :root_message_id) + and (select tree_right(fm.tree_sortkey) from forums_messages fm where fm.message_id = :root_message_id) + ORDER BY fma.message_id