Revision 11912
Added by Aaron Marcuse-Kubitza almost 11 years ago
schema.sql | ||
---|---|---|
306 | 306 |
|
307 | 307 |
|
308 | 308 |
-- |
309 |
-- Name: taxon_scrub.scrubbed_unique_taxon_name.*; Type: VIEW; Schema: TNRS; Owner: - |
|
310 |
-- |
|
311 |
|
|
312 |
CREATE VIEW "taxon_scrub.scrubbed_unique_taxon_name.*" AS |
|
313 |
SELECT tnrs."Name_submitted" AS scrubbed_unique_taxon_name, |
|
314 |
tnrs."Name_matched_rank" AS scrubbed_taxon_rank, |
|
315 |
tnrs."Name_matched_accepted_family" AS scrubbed_family, |
|
316 |
tnrs."Genus_matched" AS scrubbed_genus, |
|
317 |
tnrs."Specific_epithet_matched" AS scrubbed_specific_epithet, |
|
318 |
tnrs."Infraspecific_rank" AS scrubbed_infraspecific_rank, |
|
319 |
tnrs."Infraspecific_epithet_matched" AS scrubbed_infraspecific_epithet, |
|
320 |
tnrs."Name_matched_author" AS scrubbed_author, |
|
321 |
tnrs."Name_matched" AS scrubbed_taxon_name_no_author |
|
322 |
FROM tnrs; |
|
323 |
|
|
324 |
|
|
325 |
-- |
|
326 |
-- Name: taxon_scrub; Type: VIEW; Schema: TNRS; Owner: - |
|
327 |
-- |
|
328 |
|
|
329 |
CREATE VIEW taxon_scrub AS |
|
330 |
SELECT "ValidMatchedTaxon".scrubbed_unique_taxon_name, |
|
331 |
"ValidMatchedTaxon"."*Name_matched.batch", |
|
332 |
"ValidMatchedTaxon"."concatenatedScientificName", |
|
333 |
"ValidMatchedTaxon"."matchedTaxonName", |
|
334 |
"ValidMatchedTaxon"."matchedTaxonRank", |
|
335 |
"ValidMatchedTaxon"."*Name_matched.Name_score", |
|
336 |
"ValidMatchedTaxon"."matchedScientificNameAuthorship", |
|
337 |
"ValidMatchedTaxon"."matchedScientificNameID", |
|
338 |
"ValidMatchedTaxon"."*Name_matched.Author_score", |
|
339 |
"ValidMatchedTaxon"."matchedFamilyConfidence_fraction", |
|
340 |
"ValidMatchedTaxon"."matchedFamily", |
|
341 |
"ValidMatchedTaxon"."matchedGenus", |
|
342 |
"ValidMatchedTaxon"."matchedGenusConfidence_fraction", |
|
343 |
"ValidMatchedTaxon"."matchedSpecificEpithet", |
|
344 |
"ValidMatchedTaxon"."matchedSpeciesConfidence_fraction", |
|
345 |
"ValidMatchedTaxon"."matchedInfraspecificEpithet", |
|
346 |
"ValidMatchedTaxon"."*Name_matched.Infraspecific_epithet_score", |
|
347 |
"ValidMatchedTaxon"."identificationQualifier", |
|
348 |
"ValidMatchedTaxon"."morphospeciesSuffix", |
|
349 |
"ValidMatchedTaxon"."taxonomicStatus", |
|
350 |
"ValidMatchedTaxon"."acceptedTaxonName", |
|
351 |
"ValidMatchedTaxon"."acceptedScientificNameAuthorship", |
|
352 |
"ValidMatchedTaxon"."acceptedTaxonRank", |
|
353 |
"ValidMatchedTaxon"."acceptedScientificNameID", |
|
354 |
"ValidMatchedTaxon"."*Name_matched.Accepted_name_species", |
|
355 |
"ValidMatchedTaxon"."acceptedFamily", |
|
356 |
"ValidMatchedTaxon"."*Name_matched.Selected", |
|
357 |
"ValidMatchedTaxon"."*Name_matched.Source", |
|
358 |
"ValidMatchedTaxon"."*Name_matched.Warnings", |
|
359 |
"ValidMatchedTaxon"."*Name_matched.Accepted_name_lsid", |
|
360 |
"ValidMatchedTaxon".taxon_scrub__is_valid_match, |
|
361 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank, |
|
362 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family, |
|
363 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_genus, |
|
364 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_specific_epithet, |
|
365 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_infraspecific_rank, |
|
366 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_infraspecific_epithet, |
|
367 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_author, |
|
368 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_no_author |
|
369 |
FROM ("ValidMatchedTaxon" |
|
370 |
LEFT JOIN "taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name)); |
|
371 |
|
|
372 |
|
|
373 |
-- |
|
374 |
-- Name: VIEW taxon_scrub; Type: COMMENT; Schema: TNRS; Owner: - |
|
375 |
-- |
|
376 |
|
|
377 |
COMMENT ON VIEW taxon_scrub IS 'to update, use * as the column list'; |
|
378 |
|
|
379 |
|
|
380 |
-- |
|
309 | 381 |
-- Name: batch; Type: TABLE; Schema: TNRS; Owner: -; Tablespace: |
310 | 382 |
-- |
311 | 383 |
|
... | ... | |
387 | 459 |
|
388 | 460 |
|
389 | 461 |
-- |
390 |
-- Name: taxon_scrub.scrubbed_unique_taxon_name.*; Type: VIEW; Schema: TNRS; Owner: - |
|
391 |
-- |
|
392 |
|
|
393 |
CREATE VIEW "taxon_scrub.scrubbed_unique_taxon_name.*" AS |
|
394 |
SELECT tnrs."Name_submitted" AS scrubbed_unique_taxon_name, |
|
395 |
tnrs."Name_matched_rank" AS scrubbed_taxon_rank, |
|
396 |
tnrs."Name_matched_accepted_family" AS scrubbed_family, |
|
397 |
tnrs."Genus_matched" AS scrubbed_genus, |
|
398 |
tnrs."Specific_epithet_matched" AS scrubbed_specific_epithet, |
|
399 |
tnrs."Infraspecific_rank" AS scrubbed_infraspecific_rank, |
|
400 |
tnrs."Infraspecific_epithet_matched" AS scrubbed_infraspecific_epithet, |
|
401 |
tnrs."Name_matched_author" AS scrubbed_author, |
|
402 |
tnrs."Name_matched" AS scrubbed_taxon_name_no_author |
|
403 |
FROM tnrs; |
|
404 |
|
|
405 |
|
|
406 |
-- |
|
407 |
-- Name: taxon_scrub; Type: VIEW; Schema: TNRS; Owner: - |
|
408 |
-- |
|
409 |
|
|
410 |
CREATE VIEW taxon_scrub AS |
|
411 |
SELECT "ValidMatchedTaxon".scrubbed_unique_taxon_name, |
|
412 |
"ValidMatchedTaxon"."*Name_matched.batch", |
|
413 |
"ValidMatchedTaxon"."concatenatedScientificName", |
|
414 |
"ValidMatchedTaxon"."matchedTaxonName", |
|
415 |
"ValidMatchedTaxon"."matchedTaxonRank", |
|
416 |
"ValidMatchedTaxon"."*Name_matched.Name_score", |
|
417 |
"ValidMatchedTaxon"."matchedScientificNameAuthorship", |
|
418 |
"ValidMatchedTaxon"."matchedScientificNameID", |
|
419 |
"ValidMatchedTaxon"."*Name_matched.Author_score", |
|
420 |
"ValidMatchedTaxon"."matchedFamilyConfidence_fraction", |
|
421 |
"ValidMatchedTaxon"."matchedFamily", |
|
422 |
"ValidMatchedTaxon"."matchedGenus", |
|
423 |
"ValidMatchedTaxon"."matchedGenusConfidence_fraction", |
|
424 |
"ValidMatchedTaxon"."matchedSpecificEpithet", |
|
425 |
"ValidMatchedTaxon"."matchedSpeciesConfidence_fraction", |
|
426 |
"ValidMatchedTaxon"."matchedInfraspecificEpithet", |
|
427 |
"ValidMatchedTaxon"."*Name_matched.Infraspecific_epithet_score", |
|
428 |
"ValidMatchedTaxon"."identificationQualifier", |
|
429 |
"ValidMatchedTaxon"."morphospeciesSuffix", |
|
430 |
"ValidMatchedTaxon"."taxonomicStatus", |
|
431 |
"ValidMatchedTaxon"."acceptedTaxonName", |
|
432 |
"ValidMatchedTaxon"."acceptedScientificNameAuthorship", |
|
433 |
"ValidMatchedTaxon"."acceptedTaxonRank", |
|
434 |
"ValidMatchedTaxon"."acceptedScientificNameID", |
|
435 |
"ValidMatchedTaxon"."*Name_matched.Accepted_name_species", |
|
436 |
"ValidMatchedTaxon"."acceptedFamily", |
|
437 |
"ValidMatchedTaxon"."*Name_matched.Selected", |
|
438 |
"ValidMatchedTaxon"."*Name_matched.Source", |
|
439 |
"ValidMatchedTaxon"."*Name_matched.Warnings", |
|
440 |
"ValidMatchedTaxon"."*Name_matched.Accepted_name_lsid", |
|
441 |
"ValidMatchedTaxon".taxon_scrub__is_valid_match, |
|
442 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank, |
|
443 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family, |
|
444 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_genus, |
|
445 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_specific_epithet, |
|
446 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_infraspecific_rank, |
|
447 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_infraspecific_epithet, |
|
448 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_author, |
|
449 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_no_author |
|
450 |
FROM ("ValidMatchedTaxon" |
|
451 |
LEFT JOIN "taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name)); |
|
452 |
|
|
453 |
|
|
454 |
-- |
|
455 |
-- Name: VIEW taxon_scrub; Type: COMMENT; Schema: TNRS; Owner: - |
|
456 |
-- |
|
457 |
|
|
458 |
COMMENT ON VIEW taxon_scrub IS 'to update, use * as the column list'; |
|
459 |
|
|
460 |
|
|
461 |
-- |
|
462 | 462 |
-- Name: batch_download_settings_pkey; Type: CONSTRAINT; Schema: TNRS; Owner: -; Tablespace: |
463 | 463 |
-- |
464 | 464 |
|
... | ... | |
579 | 579 |
|
580 | 580 |
|
581 | 581 |
-- |
582 |
-- Name: MatchedTaxon; Type: ACL; Schema: TNRS; Owner: - |
|
583 |
-- |
|
584 |
|
|
585 |
REVOKE ALL ON TABLE "MatchedTaxon" FROM PUBLIC; |
|
586 |
REVOKE ALL ON TABLE "MatchedTaxon" FROM bien; |
|
587 |
GRANT ALL ON TABLE "MatchedTaxon" TO bien; |
|
588 |
GRANT SELECT ON TABLE "MatchedTaxon" TO bien_read; |
|
589 |
|
|
590 |
|
|
591 |
-- |
|
592 |
-- Name: ValidMatchedTaxon; Type: ACL; Schema: TNRS; Owner: - |
|
593 |
-- |
|
594 |
|
|
595 |
REVOKE ALL ON TABLE "ValidMatchedTaxon" FROM PUBLIC; |
|
596 |
REVOKE ALL ON TABLE "ValidMatchedTaxon" FROM bien; |
|
597 |
GRANT ALL ON TABLE "ValidMatchedTaxon" TO bien; |
|
598 |
GRANT SELECT ON TABLE "ValidMatchedTaxon" TO bien_read; |
|
599 |
|
|
600 |
|
|
601 |
-- |
|
602 |
-- Name: taxon_scrub.scrubbed_unique_taxon_name.*; Type: ACL; Schema: TNRS; Owner: - |
|
603 |
-- |
|
604 |
|
|
605 |
REVOKE ALL ON TABLE "taxon_scrub.scrubbed_unique_taxon_name.*" FROM PUBLIC; |
|
606 |
REVOKE ALL ON TABLE "taxon_scrub.scrubbed_unique_taxon_name.*" FROM bien; |
|
607 |
GRANT ALL ON TABLE "taxon_scrub.scrubbed_unique_taxon_name.*" TO bien; |
|
608 |
GRANT SELECT ON TABLE "taxon_scrub.scrubbed_unique_taxon_name.*" TO bien_read; |
|
609 |
|
|
610 |
|
|
611 |
-- |
|
612 |
-- Name: taxon_scrub; Type: ACL; Schema: TNRS; Owner: - |
|
613 |
-- |
|
614 |
|
|
615 |
REVOKE ALL ON TABLE taxon_scrub FROM PUBLIC; |
|
616 |
REVOKE ALL ON TABLE taxon_scrub FROM bien; |
|
617 |
GRANT ALL ON TABLE taxon_scrub TO bien; |
|
618 |
GRANT SELECT ON TABLE taxon_scrub TO bien_read; |
|
619 |
|
|
620 |
|
|
621 |
-- |
|
582 | 622 |
-- PostgreSQL database dump complete |
583 | 623 |
-- |
584 | 624 |
|
Also available in: Unified diff
bugfix: inputs/.TNRS/schema.sql: granted bien_read SELECT access to derived views as well as the core tnrs table