Project

General

Profile

« Previous | Next » 

Revision 11735

schemas/vegbien.sql: collected_date_min: replaced with collected_dates view that lists all dates we have, so that we can determine which of these may be valid. it turns out that we have data collected from very far back (to the year 1), which are not merely 2-digit years because PostgreSQL will only parse early years when there are 4 digits.

View differences:

schemas/vegbien.my.sql
1767 1767

  
1768 1768

  
1769 1769
--
1770
-- Name: collected_date_min; Type: VIEW; Schema: public; Owner: -
1770
-- Name: collected_dates; Type: VIEW; Schema: public; Owner: -
1771 1771
--
1772 1772

  
1773 1773

  
......
7697 7697

  
7698 7698

  
7699 7699
--
7700
-- Name: collected_date_min; Type: ACL; Schema: public; Owner: -
7700
-- Name: collected_dates; Type: ACL; Schema: public; Owner: -
7701 7701
--
7702 7702

  
7703 7703

  
schemas/vegbien.sql
2996 2996

  
2997 2997

  
2998 2998
--
2999
-- Name: collected_date_min; Type: VIEW; Schema: public; Owner: -
2999
-- Name: collected_dates; Type: VIEW; Schema: public; Owner: -
3000 3000
--
3001 3001

  
3002
CREATE VIEW collected_date_min AS
3003
 SELECT analytical_stem."dateCollected"
3002
CREATE VIEW collected_dates AS
3003
 SELECT DISTINCT analytical_stem."dateCollected"
3004 3004
   FROM analytical_stem
3005
  WHERE (analytical_stem."dateCollected" >= '1000-01-01'::date)
3006
  ORDER BY analytical_stem."dateCollected"
3007
 LIMIT 1;
3005
  ORDER BY analytical_stem."dateCollected";
3008 3006

  
3009 3007

  
3010 3008
--
......
9347 9345

  
9348 9346

  
9349 9347
--
9350
-- Name: collected_date_min; Type: ACL; Schema: public; Owner: -
9348
-- Name: collected_dates; Type: ACL; Schema: public; Owner: -
9351 9349
--
9352 9350

  
9353
REVOKE ALL ON TABLE collected_date_min FROM PUBLIC;
9354
REVOKE ALL ON TABLE collected_date_min FROM bien;
9355
GRANT ALL ON TABLE collected_date_min TO bien;
9356
GRANT SELECT ON TABLE collected_date_min TO bien_read;
9357
GRANT SELECT ON TABLE collected_date_min TO public_;
9351
REVOKE ALL ON TABLE collected_dates FROM PUBLIC;
9352
REVOKE ALL ON TABLE collected_dates FROM bien;
9353
GRANT ALL ON TABLE collected_dates TO bien;
9354
GRANT SELECT ON TABLE collected_dates TO bien_read;
9355
GRANT SELECT ON TABLE collected_dates TO public_;
9358 9356

  
9359 9357

  
9360 9358
--

Also available in: Unified diff