postgresql7.1 select site_node__delete(:node_id); select n.node_id, n.parent_id, n.name, n.directory_p, n.pattern_p, n.object_id, p.package_key, p.package_id, p.instance_name, t.package_type from site_nodes n left join apm_packages p on n.object_id = p.package_id left join apm_package_types t using (package_key) where n.tree_sortkey between site_node_get_tree_sortkey(:node_id) and tree_right(site_node_get_tree_sortkey(:node_id)) order by n.tree_sortkey select n.node_id, n.parent_id, n.name, n.directory_p, n.pattern_p, n.object_id, p.package_key, p.package_id, p.instance_name, t.package_type from site_nodes n left join apm_packages p on n.object_id = p.package_id left join apm_package_types t using (package_key) where n.node_id = :node_id select site_node__url(node_id) from site_nodes where object_id = :object_id order by site_node__url(node_id) desc