postgresql7.4 SELECT report_id FROM lr_report WHERE template_id = :template_id AND author_id = :author_id AND package_id = :package_id