Project

General

Profile

« Previous | Next » 

Revision 14304

inputs/.TNRS/schema.sql: taxon_match: added derived column "[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org"

View differences:

vegbien.sql
19375 19375
		"*Unmatched_terms"
19376 19376
		FROM (SELECT new.*) new);
19377 19377
	
19378
	new."[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" = (SELECT
19379
		CASE
19380
        WHEN ("*Accepted_name_rank" = 'family'::text) THEN concat_ws(' '::text, "*Accepted_name_family", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org")
19381
        WHEN ("*Accepted_name_rank" = 'genus'::text) THEN concat_ws(' '::text, "*Accepted_name", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org")
19382
        ELSE "*Accepted_name_species"
19383
    END
19384
		FROM (SELECT new.*) new);
19385
	
19378 19386
	RETURN new;
19379 19387
END;
19380 19388
$$;
......
19569 19577
    "[scrubbed_]author~(-Accepted_-)__@TNRS__@vegpath.org" text,
19570 19578
    "[scrubbed_]scientificName[_with_author]__@DwC__@vegpath.org" text,
19571 19579
    "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org" text,
19580
    "[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" text,
19572 19581
    CONSTRAINT "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" CHECK ((NOT ("[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" IS DISTINCT FROM "__accepted_infraspecific_{rank,epithet}"[1]))),
19573 19582
    CONSTRAINT "[accepted_]genus__@DwC__@vegpath.org" CHECK ((NOT ("[accepted_]genus__@DwC__@vegpath.org" IS DISTINCT FROM "__accepted_{genus,specific_epithet}"[1]))),
19574 19583
    CONSTRAINT "[accepted_]infraspecificEpithet__@DwC__@vegpath.org" CHECK ((NOT ("[accepted_]infraspecificEpithet__@DwC__@vegpath.org" IS DISTINCT FROM "__accepted_infraspecific_{rank,epithet}"[2]))),
19584
    CONSTRAINT "[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" CHECK ((NOT ("[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" IS DISTINCT FROM
19585
CASE
19586
    WHEN ("*Accepted_name_rank" = 'family'::text) THEN concat_ws(' '::text, "*Accepted_name_family", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org")
19587
    WHEN ("*Accepted_name_rank" = 'genus'::text) THEN concat_ws(' '::text, "*Accepted_name", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org")
19588
    ELSE "*Accepted_name_species"
19589
END))),
19575 19590
    CONSTRAINT "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" CHECK ((NOT ("[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" IS DISTINCT FROM ("*Accepted_name" || COALESCE((' '::text || "*Accepted_name_author"), ''::text))))),
19576 19591
    CONSTRAINT "[accepted_]specificEpithet__@DwC__@vegpath.org" CHECK ((NOT ("[accepted_]specificEpithet__@DwC__@vegpath.org" IS DISTINCT FROM "__accepted_{genus,specific_epithet}"[2]))),
19577 19592
    CONSTRAINT "[matched_]scientificName[_with_author]__@DwC__@vegpath.org" CHECK ((NOT ("[matched_]scientificName[_with_author]__@DwC__@vegpath.org" IS DISTINCT FROM ("*Name_matched" || COALESCE((' '::text || "*Name_matched_author"), ''::text))))),
......
20164 20179

  
20165 20180

  
20166 20181
--
20182
-- Name: COLUMN taxon_match."[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org"; Type: COMMENT; Schema: TNRS; Owner: -
20183
--
20184

  
20185
COMMENT ON COLUMN taxon_match."[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" IS '
20186
= 
20187
        CASE
20188
            WHEN "*Accepted_name_rank" = ''family''::text THEN concat_ws('' ''::text, "*Accepted_name_family", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org")
20189
            WHEN "*Accepted_name_rank" = ''genus''::text THEN concat_ws('' ''::text, "*Accepted_name", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org")
20190
            ELSE "*Accepted_name_species"
20191
        END
20192

  
20193
derived column
20194

  
20195
to modify expr:
20196
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org'')::util.col, $$CASE
20197
        WHEN ("*Accepted_name_rank" = ''family''::text) THEN concat_ws('' ''::text, "*Accepted_name_family", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org")
20198
        WHEN ("*Accepted_name_rank" = ''genus''::text) THEN concat_ws('' ''::text, "*Accepted_name", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org")
20199
        ELSE "*Accepted_name_species"
20200
    END$$)::util.derived_col_def);
20201
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
20202

  
20203
to rename:
20204
# rename column
20205
# rename CHECK constraint
20206
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
20207
';
20208

  
20209

  
20210
--
20167 20211
-- Name: taxon_best_match; Type: VIEW; Schema: TNRS; Owner: -
20168 20212
--
20169 20213

  

Also available in: Unified diff