   LEFT JOIN specimen_individuals  i ON s.id = i.specimen_ref 
   LEFT JOIN specimen_parts p ON i.id = p.specimen_individual_ref
 ;
+
+ALTER VIEW darwin_flat OWNER TO darwin2;
+
+GRANT ALL ON darwin_flat TO darwin2;
+GRANT SELECT ON darwin_flat TO d2viewer;
+

\i ../reports/ticketing/labeling.sql







/********** RESET VIEW *************/


create view darwin_flat as 
  select



ALTER TABLE specimens_flat OWNER TO darwin2;
ALTER TABLE specimens_flat_id_seq OWNER TO darwin2;

GRANT ALL ON specimens_flat TO darwin2;
GRANT SELECT ON specimens_flat TO d2viewer;

commit;

