 
 
 ALTER TABLE specimens_flat OWNER TO darwin2;
-
-GRANT ALL ON TABLE specimens_flat TO darwin2;
-GRANT SELECT ON TABLE specimens_flat TO d2viewer;
+ALTER TABLE specimens_flat_id_seq OWNER TO darwin2;
+
+GRANT ALL ON specimens_flat TO darwin2;
+GRANT SELECT ON specimens_flat TO d2viewer;
 
 commit;
 

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







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


create view darwin_flat as 
  select

  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;

