postgresql7.1 select item_id from attachments where object_id = :object_id and approved_p = 't' select item_id, acs_object__name(item_id), approved_p from attachments where object_id = :object_id