postgresql7.1
select site_node__url(node_id)
from site_nodes
where object_id = (select package_id
from forums_forums
where forums_forums.forum_id = :forum_id)
select site_node__url(node_id)
from site_nodes
where object_id = (select package_id
from forums_forums
where forums_forums.forum_id = :forum_id)
select subject, content, html_p
from forums_messages
where message_id=:message_id or (tree_sortkey between tree_left(:tree_sortkey) and tree_right(:tree_sortkey))
and forum_id=:forum_id
order by tree_sortkey