Project

General

Profile

« Previous | Next » 

Revision 14309

bugfix: schemas/util.sql: derived_cols_trigger_update(): need to clear derived cols first so old values won't be used in calculations

View differences:

schema.sql
195 195
    LANGUAGE plpgsql
196 196
    AS $$
197 197
BEGIN
198
	-- clear derived cols so old values won't be used in calculations
199
	new."[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" = NULL;
200
	new."[matched_]scientificName[_with_author]__@DwC__@vegpath.org" = NULL;
201
	new.matched_has_accepted = NULL;
202
	new."__accepted_{genus,specific_epithet}" = NULL;
203
	new."[accepted_]genus__@DwC__@vegpath.org" = NULL;
204
	new."[accepted_]specificEpithet__@DwC__@vegpath.org" = NULL;
205
	new.__accepted_infraspecific_label = NULL;
206
	new."__accepted_infraspecific_{rank,epithet}" = NULL;
207
	new."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" = NULL;
208
	new."[accepted_]infraspecificEpithet__@DwC__@vegpath.org" = NULL;
209
	new."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" = NULL;
210
	new."[scrubbed_]taxonRank__@DwC__@vegpath.org" = NULL;
211
	new."[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org" = NULL;
212
	new."[scrubbed_]genus__@DwC__@vegpath.org" = NULL;
213
	new."[scrubbed_]specificEpithet__@DwC__@vegpath.org" = NULL;
214
	new."[scrubbed_]species[_binom]~(-Accepted_-)__@TNRS__@vegpath.org" = NULL;
215
	new."[scrubbed_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" = NULL;
216
	new."[scrubbed_]infraspecificEpithet__@DwC__@vegpath.org" = NULL;
217
	new."[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org" = NULL;
218
	new."[scrubbed_]author~(-Accepted_-)__@TNRS__@vegpath.org" = NULL;
219
	new."[scrubbed_]scientificName[_with_author]__@DwC__@vegpath.org" = NULL;
220
	new."[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org" = NULL;
221
	new."[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" = NULL;
222
	
223
	-- populate derived cols
198 224
	new."[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT ("*Genus_matched" || ' '::text) || "*Specific_epithet_matched" FROM (SELECT new.*) new);
199 225
	new."[matched_]scientificName[_with_author]__@DwC__@vegpath.org" = (SELECT "*Name_matched" || COALESCE((' '::text || "*Name_matched_author"), ''::text) FROM (SELECT new.*) new);
200 226
	new.matched_has_accepted = (SELECT "*Accepted_name" IS NOT NULL FROM (SELECT new.*) new);

Also available in: Unified diff