postgresql7.1 select content_keyword__new ( :heading, :description, :parent_id, :keyword_id, current_timestamp, :user_id, :creation_ip, :object_type, :package_id ) select content_keyword__delete (:keyword_id) select content_keyword__set_heading(:keyword_id, :heading) select content_keyword__item_assign( :item_id, :keyword, null, null, null ) select content_symlink__new ( :name, :label, :target_id, :parent_id, :symlink_id, current_timestamp, :creation_user, :creation_ip, :package_id ); select content_symlink__delete ( :symlink_id ); select content_symlink__is_symlink ( :item_id ); select content_symlink__resolve ( :item_id ); select content_symlink__resolve_content_type ( :item_id ); , content as text select 't' from cr_revisions r, cr_items i where r.revision_id = :revision_id and i.item_id = r.item_id and ((r.content is not null and i.storage_type in ('text','file')) or (r.lob is not null and i.storage_type = 'lob')) select content_extlink__new ( :name, :url, :label, :description, :parent_id, :extlink_id, current_timestamp, :creation_user, :creation_ip, :package_id ); select content_extlink__delete ( :extlink_id ); select content_extlink__is_extlink ( :item_id ); With RECURSIVE child_items AS ( select 0 as lvl, i.item_id, ''::text as name, i.parent_id, 'Home'::text as title from cr_items i, cr_revisions r where i.item_id = :item_id and i.live_revision = r.revision_id UNION ALL select child_items.lvl+1, i.item_id, i.name, i.parent_id, r.title from cr_items i, cr_revisions r, child_items where i.parent_id = child_items.item_id and i.live_revision = r.revision_id ) select * from child_items; select content_folder__delete(:folder_id)