postgresql7.1
select site_node__url(node_id) as path
from site_nodes
where object_id in (select package_id
from apm_packages where package_key = 'bookmarks')
delete from bm_in_closed_p where creation_date < (current_timestamp - interval '$max_days day')