postgresql7.1 and bookmark_id not in ( select bm.bookmark_id from bm_bookmarks bm, bm_bookmarks bm2 where bm.folder_p = 't' and bm.owner_id = :user_id and bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey) and bm2.parent_id = :package_id and bm2.owner_id = :user_id ) select bm.bookmark_id, bm.local_title, tree_level(bm.tree_sortkey) as indentation from bm_bookmarks bm, bm_bookmarks bm2 where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey) and bm2.parent_id = :package_id and bm2.owner_id = :user_id and bm.folder_p = 't' and bm.owner_id = :user_id and bm.bookmark_id <> :bookmark_id and bm.parent_id <> :package_id and acs_permission__permission_p(:bookmark_id, :user_id, 'write') = 't' $exclude_folders order by bm.tree_sortkey select bookmark__get_root_folder (:package_id, :user_id); select count(*) from bm_bookmarks where owner_id = :viewed_user_id and folder_p = 't' and acs_permission__permission_p(bookmark_id, :browsing_user_id, 'write') select count(*) from bm_bookmarks bm, bm_bookmarks bm2 where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey) and bm2.bookmark_id = :bookmark_id and not acs_permission__permission_p(bm.bookmark_id, :browsing_user_id, 'delete') select bookmark__private_p(:bookmark_id) select bookmark__update_private_p(:bookmark_id, :private_p) select bookmark__initialize_in_closed_p (:viewed_user_id, :in_closed_p_id);