Project

General

Profile

« Previous | Next » 

Revision 14282

bugfix: schemas/util.sql: derived_col_update(): column comment: need to use expr from DB, not as provided by user, to avoid this changing when derived_col_update() is rerun

View differences:

vegbien.sql
19311 19311
	
19312 19312
	new."[scrubbed_]taxonRank__@DwC__@vegpath.org" = (SELECT
19313 19313
		CASE
19314
        WHEN matched_has_accepted THEN "*Accepted_name_rank"
19315
        ELSE "*Name_matched_rank"
19316
    END
19314
    WHEN matched_has_accepted THEN "*Accepted_name_rank"
19315
    ELSE "*Name_matched_rank"
19316
END
19317 19317
		FROM (SELECT new.*) new);
19318 19318
	
19319 19319
	new."[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT
19320 19320
		CASE
19321
        WHEN matched_has_accepted THEN "*Accepted_name_family"
19322
        ELSE "*Name_matched_accepted_family"
19323
    END
19321
    WHEN matched_has_accepted THEN "*Accepted_name_family"
19322
    ELSE "*Name_matched_accepted_family"
19323
END
19324 19324
		FROM (SELECT new.*) new);
19325 19325
	
19326 19326
	new."[scrubbed_]genus__@DwC__@vegpath.org" = (SELECT
19327 19327
		CASE
19328
        WHEN matched_has_accepted THEN "[accepted_]genus__@DwC__@vegpath.org"
19329
        ELSE "*Genus_matched"
19330
    END
19328
    WHEN matched_has_accepted THEN "[accepted_]genus__@DwC__@vegpath.org"
19329
    ELSE "*Genus_matched"
19330
END
19331 19331
		FROM (SELECT new.*) new);
19332 19332
	
19333 19333
	new."[scrubbed_]specificEpithet__@DwC__@vegpath.org" = (SELECT
19334 19334
		CASE
19335
        WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
19336
        ELSE "*Specific_epithet_matched"
19337
    END
19335
    WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
19336
    ELSE "*Specific_epithet_matched"
19337
END
19338 19338
		FROM (SELECT new.*) new);
19339 19339
	
19340 19340
	new."[scrubbed_]species[_binom]~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT
19341 19341
		CASE
19342
        WHEN matched_has_accepted THEN "*Accepted_name_species"
19343
        ELSE "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org"
19344
    END
19342
    WHEN matched_has_accepted THEN "*Accepted_name_species"
19343
    ELSE "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org"
19344
END
19345 19345
		FROM (SELECT new.*) new);
19346 19346
	
19347 19347
	new."[scrubbed_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" = (SELECT
19348 19348
		CASE
19349
        WHEN matched_has_accepted THEN "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org"
19350
        ELSE "*Infraspecific_rank"
19351
    END
19349
    WHEN matched_has_accepted THEN "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org"
19350
    ELSE "*Infraspecific_rank"
19351
END
19352 19352
		FROM (SELECT new.*) new);
19353 19353
	
19354 19354
	new."[scrubbed_]infraspecificEpithet__@DwC__@vegpath.org" = (SELECT
19355 19355
		CASE
19356
        WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
19357
        ELSE "*Infraspecific_epithet_matched"
19358
    END
19356
    WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
19357
    ELSE "*Infraspecific_epithet_matched"
19358
END
19359 19359
		FROM (SELECT new.*) new);
19360 19360
	
19361 19361
	new."[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT
19362 19362
		CASE
19363
        WHEN matched_has_accepted THEN "*Accepted_name"
19364
        ELSE "*Name_matched"
19365
    END
19363
    WHEN matched_has_accepted THEN "*Accepted_name"
19364
    ELSE "*Name_matched"
19365
END
19366 19366
		FROM (SELECT new.*) new);
19367 19367
	
19368 19368
	new."[scrubbed_]author~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT
19369 19369
		CASE
19370
        WHEN matched_has_accepted THEN "*Accepted_name_author"
19371
        ELSE "*Name_matched_author"
19372
    END
19370
    WHEN matched_has_accepted THEN "*Accepted_name_author"
19371
    ELSE "*Name_matched_author"
19372
END
19373 19373
		FROM (SELECT new.*) new);
19374 19374
	
19375 19375
	new."[scrubbed_]scientificName[_with_author]__@DwC__@vegpath.org" = (SELECT
19376 19376
		CASE
19377
        WHEN matched_has_accepted THEN "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org"
19378
        ELSE "[matched_]scientificName[_with_author]__@DwC__@vegpath.org"
19379
    END
19377
    WHEN matched_has_accepted THEN "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org"
19378
    ELSE "[matched_]scientificName[_with_author]__@DwC__@vegpath.org"
19379
END
19380 19380
		FROM (SELECT new.*) new);
19381 19381
	
19382 19382
	RETURN new;
......
19673 19673
derived column; = ("*Genus_matched" || '' ''::text) || "*Specific_epithet_matched"
19674 19674

  
19675 19675
to modify expr:
19676
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$"*Genus_matched" || '' ''::text || "*Specific_epithet_matched"$$)::util.derived_col_def);
19676
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$("*Genus_matched" || '' ''::text) || "*Specific_epithet_matched"$$)::util.derived_col_def);
19677 19677
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
19678 19678

  
19679 19679
to rename:
......
19869 19869

  
19870 19870
COMMENT ON COLUMN taxon_match."[scrubbed_]taxonRank__@DwC__@vegpath.org" IS '
19871 19871
derived column; = CASE
19872
        WHEN matched_has_accepted THEN "*Accepted_name_rank"
19873
        ELSE "*Name_matched_rank"
19874
    END
19872
    WHEN matched_has_accepted THEN "*Accepted_name_rank"
19873
    ELSE "*Name_matched_rank"
19874
END
19875 19875

  
19876 19876
to modify expr:
19877
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]taxonRank__@DwC__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "*Accepted_name_rank" ELSE "*Name_matched_rank" END$$)::util.derived_col_def);
19877
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]taxonRank__@DwC__@vegpath.org'')::util.col, $$CASE
19878
    WHEN matched_has_accepted THEN "*Accepted_name_rank"
19879
    ELSE "*Name_matched_rank"
19880
END$$)::util.derived_col_def);
19878 19881
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
19879 19882

  
19880 19883
to rename:
......
19890 19893

  
19891 19894
COMMENT ON COLUMN taxon_match."[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org" IS '
19892 19895
derived column; = CASE
19893
        WHEN matched_has_accepted THEN "*Accepted_name_family"
19894
        ELSE "*Name_matched_accepted_family"
19895
    END
19896
    WHEN matched_has_accepted THEN "*Accepted_name_family"
19897
    ELSE "*Name_matched_accepted_family"
19898
END
19896 19899

  
19897 19900
to modify expr:
19898
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "*Accepted_name_family" ELSE "*Name_matched_accepted_family" END$$)::util.derived_col_def);
19901
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$CASE
19902
    WHEN matched_has_accepted THEN "*Accepted_name_family"
19903
    ELSE "*Name_matched_accepted_family"
19904
END$$)::util.derived_col_def);
19899 19905
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
19900 19906

  
19901 19907
to rename:
......
19911 19917

  
19912 19918
COMMENT ON COLUMN taxon_match."[scrubbed_]genus__@DwC__@vegpath.org" IS '
19913 19919
derived column; = CASE
19914
        WHEN matched_has_accepted THEN "[accepted_]genus__@DwC__@vegpath.org"
19915
        ELSE "*Genus_matched"
19916
    END
19920
    WHEN matched_has_accepted THEN "[accepted_]genus__@DwC__@vegpath.org"
19921
    ELSE "*Genus_matched"
19922
END
19917 19923

  
19918 19924
to modify expr:
19919
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]genus__@DwC__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "[accepted_]genus__@DwC__@vegpath.org" ELSE "*Genus_matched" END$$)::util.derived_col_def);
19925
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]genus__@DwC__@vegpath.org'')::util.col, $$CASE
19926
    WHEN matched_has_accepted THEN "[accepted_]genus__@DwC__@vegpath.org"
19927
    ELSE "*Genus_matched"
19928
END$$)::util.derived_col_def);
19920 19929
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
19921 19930

  
19922 19931
to rename:
......
19932 19941

  
19933 19942
COMMENT ON COLUMN taxon_match."[scrubbed_]specificEpithet__@DwC__@vegpath.org" IS '
19934 19943
derived column; = CASE
19935
        WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
19936
        ELSE "*Specific_epithet_matched"
19937
    END
19944
    WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
19945
    ELSE "*Specific_epithet_matched"
19946
END
19938 19947

  
19939 19948
to modify expr:
19940
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]specificEpithet__@DwC__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org" ELSE "*Specific_epithet_matched" END$$)::util.derived_col_def);
19949
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]specificEpithet__@DwC__@vegpath.org'')::util.col, $$CASE
19950
    WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
19951
    ELSE "*Specific_epithet_matched"
19952
END$$)::util.derived_col_def);
19941 19953
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
19942 19954

  
19943 19955
to rename:
......
19953 19965

  
19954 19966
COMMENT ON COLUMN taxon_match."[scrubbed_]species[_binom]~(-Accepted_-)__@TNRS__@vegpath.org" IS '
19955 19967
derived column; = CASE
19956
        WHEN matched_has_accepted THEN "*Accepted_name_species"
19957
        ELSE "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org"
19958
    END
19968
    WHEN matched_has_accepted THEN "*Accepted_name_species"
19969
    ELSE "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org"
19970
END
19959 19971

  
19960 19972
to modify expr:
19961
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]species[_binom]~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "*Accepted_name_species" ELSE "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" END$$)::util.derived_col_def);
19973
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]species[_binom]~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$CASE
19974
    WHEN matched_has_accepted THEN "*Accepted_name_species"
19975
    ELSE "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org"
19976
END$$)::util.derived_col_def);
19962 19977
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
19963 19978

  
19964 19979
to rename:
......
19974 19989

  
19975 19990
COMMENT ON COLUMN taxon_match."[scrubbed_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" IS '
19976 19991
derived column; = CASE
19977
        WHEN matched_has_accepted THEN "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org"
19978
        ELSE "*Infraspecific_rank"
19979
    END
19992
    WHEN matched_has_accepted THEN "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org"
19993
    ELSE "*Infraspecific_rank"
19994
END
19980 19995

  
19981 19996
to modify expr:
19982
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" ELSE "*Infraspecific_rank" END$$)::util.derived_col_def);
19997
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org'')::util.col, $$CASE
19998
    WHEN matched_has_accepted THEN "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org"
19999
    ELSE "*Infraspecific_rank"
20000
END$$)::util.derived_col_def);
19983 20001
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
19984 20002

  
19985 20003
to rename:
......
19995 20013

  
19996 20014
COMMENT ON COLUMN taxon_match."[scrubbed_]infraspecificEpithet__@DwC__@vegpath.org" IS '
19997 20015
derived column; = CASE
19998
        WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
19999
        ELSE "*Infraspecific_epithet_matched"
20000
    END
20016
    WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
20017
    ELSE "*Infraspecific_epithet_matched"
20018
END
20001 20019

  
20002 20020
to modify expr:
20003
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]infraspecificEpithet__@DwC__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org" ELSE "*Infraspecific_epithet_matched" END$$)::util.derived_col_def);
20021
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]infraspecificEpithet__@DwC__@vegpath.org'')::util.col, $$CASE
20022
    WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org"
20023
    ELSE "*Infraspecific_epithet_matched"
20024
END$$)::util.derived_col_def);
20004 20025
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
20005 20026

  
20006 20027
to rename:
......
20016 20037

  
20017 20038
COMMENT ON COLUMN taxon_match."[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org" IS '
20018 20039
derived column; = CASE
20019
        WHEN matched_has_accepted THEN "*Accepted_name"
20020
        ELSE "*Name_matched"
20021
    END
20040
    WHEN matched_has_accepted THEN "*Accepted_name"
20041
    ELSE "*Name_matched"
20042
END
20022 20043

  
20023 20044
to modify expr:
20024
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "*Accepted_name" ELSE "*Name_matched" END$$)::util.derived_col_def);
20045
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$CASE
20046
    WHEN matched_has_accepted THEN "*Accepted_name"
20047
    ELSE "*Name_matched"
20048
END$$)::util.derived_col_def);
20025 20049
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
20026 20050

  
20027 20051
to rename:
......
20037 20061

  
20038 20062
COMMENT ON COLUMN taxon_match."[scrubbed_]author~(-Accepted_-)__@TNRS__@vegpath.org" IS '
20039 20063
derived column; = CASE
20040
        WHEN matched_has_accepted THEN "*Accepted_name_author"
20041
        ELSE "*Name_matched_author"
20042
    END
20064
    WHEN matched_has_accepted THEN "*Accepted_name_author"
20065
    ELSE "*Name_matched_author"
20066
END
20043 20067

  
20044 20068
to modify expr:
20045
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]author~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "*Accepted_name_author" ELSE "*Name_matched_author" END$$)::util.derived_col_def);
20069
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]author~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$CASE
20070
    WHEN matched_has_accepted THEN "*Accepted_name_author"
20071
    ELSE "*Name_matched_author"
20072
END$$)::util.derived_col_def);
20046 20073
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
20047 20074

  
20048 20075
to rename:
......
20058 20085

  
20059 20086
COMMENT ON COLUMN taxon_match."[scrubbed_]scientificName[_with_author]__@DwC__@vegpath.org" IS '
20060 20087
derived column; = CASE
20061
        WHEN matched_has_accepted THEN "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org"
20062
        ELSE "[matched_]scientificName[_with_author]__@DwC__@vegpath.org"
20063
    END
20088
    WHEN matched_has_accepted THEN "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org"
20089
    ELSE "[matched_]scientificName[_with_author]__@DwC__@vegpath.org"
20090
END
20064 20091

  
20065 20092
to modify expr:
20066
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]scientificName[_with_author]__@DwC__@vegpath.org'')::util.col, $$CASE WHEN matched_has_accepted THEN "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" ELSE "[matched_]scientificName[_with_author]__@DwC__@vegpath.org" END$$)::util.derived_col_def);
20093
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[scrubbed_]scientificName[_with_author]__@DwC__@vegpath.org'')::util.col, $$CASE
20094
    WHEN matched_has_accepted THEN "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org"
20095
    ELSE "[matched_]scientificName[_with_author]__@DwC__@vegpath.org"
20096
END$$)::util.derived_col_def);
20067 20097
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
20068 20098

  
20069 20099
to rename:

Also available in: Unified diff