Project

General

Profile

« Previous | Next » 

Revision 7097

schemas/vegbien.sql: unscrubbed_taxondetermination_view: Use `SELECT source_id FROM source WHERE shortname = ...` instead of source_by_shortname() so that the source table is updated to point to the same schema as the view rather than pointing to whichever version (usually public) is first in the search_path

View differences:

schemas/vegbien.sql
4512 4512
--
4513 4513

  
4514 4514
CREATE VIEW unscrubbed_taxondetermination_view AS
4515
    SELECT taxondetermination.taxonoccurrence_id, tnrs."Time_submitted", tnrs."Name_number", tnrs."Name_submitted", tnrs."Overall_score", tnrs."Name_matched", tnrs."Name_matched_rank", tnrs."Name_score", tnrs."Name_matched_author", tnrs."Name_matched_url", tnrs."Author_matched", tnrs."Author_score", tnrs."Family_matched", tnrs."Family_score", tnrs."Name_matched_accepted_family", tnrs."Genus_matched", tnrs."Genus_score", tnrs."Specific_epithet_matched", tnrs."Specific_epithet_score", tnrs."Infraspecific_rank", tnrs."Infraspecific_epithet_matched", tnrs."Infraspecific_epithet_score", tnrs."Infraspecific_rank_2", tnrs."Infraspecific_epithet_2_matched", tnrs."Infraspecific_epithet_2_score", tnrs."Annotations", tnrs."Unmatched_terms", tnrs."Taxonomic_status", tnrs."Accepted_name", tnrs."Accepted_name_author", tnrs."Accepted_name_rank", tnrs."Accepted_name_url", tnrs."Accepted_name_species", tnrs."Accepted_name_family", tnrs."Selected", tnrs."Source", tnrs."Warnings", tnrs."Accepted_name_lsid" FROM (((taxondetermination LEFT JOIN taxonverbatim USING (taxonverbatim_id)) LEFT JOIN taxonlabel USING (taxonlabel_id)) LEFT JOIN "TNRS".tnrs ON ((tnrs."Name_submitted" = taxonlabel.taxonomicname))) WHERE ((taxondetermination.iscurrent AND (taxondetermination.source_id <> source_by_shortname('TNRS'::text))) AND (tnrs."Name_submitted" IS NOT NULL)) ORDER BY taxondetermination.taxondetermination_id;
4515
    SELECT taxondetermination.taxonoccurrence_id, tnrs."Time_submitted", tnrs."Name_number", tnrs."Name_submitted", tnrs."Overall_score", tnrs."Name_matched", tnrs."Name_matched_rank", tnrs."Name_score", tnrs."Name_matched_author", tnrs."Name_matched_url", tnrs."Author_matched", tnrs."Author_score", tnrs."Family_matched", tnrs."Family_score", tnrs."Name_matched_accepted_family", tnrs."Genus_matched", tnrs."Genus_score", tnrs."Specific_epithet_matched", tnrs."Specific_epithet_score", tnrs."Infraspecific_rank", tnrs."Infraspecific_epithet_matched", tnrs."Infraspecific_epithet_score", tnrs."Infraspecific_rank_2", tnrs."Infraspecific_epithet_2_matched", tnrs."Infraspecific_epithet_2_score", tnrs."Annotations", tnrs."Unmatched_terms", tnrs."Taxonomic_status", tnrs."Accepted_name", tnrs."Accepted_name_author", tnrs."Accepted_name_rank", tnrs."Accepted_name_url", tnrs."Accepted_name_species", tnrs."Accepted_name_family", tnrs."Selected", tnrs."Source", tnrs."Warnings", tnrs."Accepted_name_lsid" FROM (((taxondetermination LEFT JOIN taxonverbatim USING (taxonverbatim_id)) LEFT JOIN taxonlabel USING (taxonlabel_id)) LEFT JOIN "TNRS".tnrs ON ((tnrs."Name_submitted" = taxonlabel.taxonomicname))) WHERE ((taxondetermination.iscurrent AND (taxondetermination.source_id <> (SELECT source.source_id FROM source WHERE (source.shortname = 'TNRS'::text)))) AND (tnrs."Name_submitted" IS NOT NULL)) ORDER BY taxondetermination.taxondetermination_id;
4516 4516

  
4517 4517

  
4518 4518
--

Also available in: Unified diff