Project

General

Profile

1 10778 aaronmk
--
2
-- PostgreSQL database dump
3
--
4 10737 aaronmk
5 10778 aaronmk
SET statement_timeout = 0;
6 11708 aaronmk
SET lock_timeout = 0;
7 10778 aaronmk
SET client_encoding = 'UTF8';
8
SET standard_conforming_strings = on;
9
SET check_function_bodies = false;
10
SET client_min_messages = warning;
11
12 10737 aaronmk
--
13 10778 aaronmk
-- Name: TNRS; Type: SCHEMA; Schema: -; Owner: -
14
--
15 10737 aaronmk
16 10778 aaronmk
--CREATE SCHEMA "TNRS";
17 10725 aaronmk
18
19 11614 aaronmk
--
20
-- Name: SCHEMA "TNRS"; Type: COMMENT; Schema: -; Owner: -
21
--
22
23 13575 aaronmk
COMMENT ON SCHEMA "TNRS" IS '
24
IMPORTANT: when changing this schema, you must also make the same changes on vegbiendev:
25 11617 aaronmk
on vegbiendev:
26
# back up existing TNRS schema (in case of an accidental incorrect change):
27 11614 aaronmk
$ make backups/TNRS.backup-remake # runtime: 3 min ("real 2m44.277s")
28 11616 aaronmk
$ svn up
29
$ svn di
30
# make the changes shown in the diff
31
## to change column types:
32 13861 aaronmk
SELECT util.set_col_types(''"TNRS".taxon_match'', ARRAY[
33 11614 aaronmk
  (''col'', ''new_type'')
34 11616 aaronmk
]::util.col_cast[]); -- runtime: 9 min ("531282 ms")
35 11617 aaronmk
$ rm=1 inputs/.TNRS/schema.sql.run
36
# repeat until `svn di` shows no diff
37
# back up new TNRS schema:
38 13575 aaronmk
$ make backups/TNRS.backup-remake # runtime: 3 min ("real 2m44.277s")
39
';
40 11614 aaronmk
41
42 10778 aaronmk
SET search_path = "TNRS", pg_catalog;
43
44
--
45
-- Name: batch__fill(); Type: FUNCTION; Schema: TNRS; Owner: -
46
--
47
48
CREATE FUNCTION batch__fill() RETURNS trigger
49
    LANGUAGE plpgsql
50
    AS $$
51 10728 aaronmk
BEGIN
52
	new.id_by_time = new.time_submitted;
53
	new.id = COALESCE(new.id, new.id_by_time);
54
	RETURN new;
55
END;
56 10778 aaronmk
$$;
57 10728 aaronmk
58
59
--
60 10778 aaronmk
-- Name: family_is_homonym(text); Type: FUNCTION; Schema: TNRS; Owner: -
61
--
62 10728 aaronmk
63 10778 aaronmk
CREATE FUNCTION family_is_homonym(family text) RETURNS boolean
64
    LANGUAGE sql STABLE STRICT
65
    AS $_$
66
SELECT EXISTS(SELECT * FROM "IRMNG".family_homonym_epithet WHERE "taxonNameOrEpithet" = $1)
67
$_$;
68 10736 aaronmk
69 10778 aaronmk
70 10736 aaronmk
--
71 10778 aaronmk
-- Name: genus_is_homonym(text); Type: FUNCTION; Schema: TNRS; Owner: -
72
--
73 10736 aaronmk
74 10778 aaronmk
CREATE FUNCTION genus_is_homonym(genus text) RETURNS boolean
75
    LANGUAGE sql STABLE STRICT
76
    AS $_$
77
SELECT EXISTS(SELECT * FROM "IRMNG".genus_homonym_epithet WHERE "taxonNameOrEpithet" = $1)
78
$_$;
79 7844 aaronmk
80 9985 aaronmk
81 10778 aaronmk
--
82 11709 aaronmk
-- Name: map_taxonomic_status(text, text); Type: FUNCTION; Schema: TNRS; Owner: -
83
--
84
85 13503 aaronmk
CREATE FUNCTION map_taxonomic_status(taxonomic_status_verbatim text, accepted_taxon_name_no_author text) RETURNS text
86 11709 aaronmk
    LANGUAGE sql IMMUTABLE
87
    AS $_$
88 13503 aaronmk
/* from http://wiki.vegpath.org/2013-11-14_conference_call#taxonomic-fields:
89
"taxonomic_status should be accepted instead of synonym when an accepted name is
90
available (this is not always the case when a name is marked as a synonym)" */
91 11709 aaronmk
SELECT CASE WHEN $2 IS NOT NULL THEN 'accepted' ELSE lower($1) END
92
$_$;
93
94
95
--
96 13868 aaronmk
-- Name: taxon_match__batch_begin(); Type: FUNCTION; Schema: TNRS; Owner: -
97 13866 aaronmk
--
98
99 13868 aaronmk
CREATE FUNCTION taxon_match__batch_begin() RETURNS trigger
100 13866 aaronmk
    LANGUAGE plpgsql
101
    AS $$
102
BEGIN
103 13869 aaronmk
	PERFORM util.seq__reset('pg_temp.taxon_match__match_num__seq', 0);
104 13567 aaronmk
	RETURN NULL;
105
END;
106
$$;
107
108
109
--
110 13868 aaronmk
-- Name: taxon_match__fill(); Type: FUNCTION; Schema: TNRS; Owner: -
111 13578 aaronmk
--
112
113 13868 aaronmk
CREATE FUNCTION taxon_match__fill() RETURNS trigger
114 13578 aaronmk
    LANGUAGE plpgsql
115
    AS $$
116 11643 aaronmk
BEGIN
117 13871 aaronmk
	DECLARE
118
		"Specific_epithet_is_plant" boolean :=
119 11628 aaronmk
			(CASE
120 14111 aaronmk
			WHEN   new."*Infraspecific_epithet_matched"	 IS NOT NULL
121
				OR new."*Infraspecific_epithet_2_matched" IS NOT NULL
122
				OR new."*Specific_epithet_score" >= 0.9 -- fuzzy match
123 13871 aaronmk
				THEN true
124
			ELSE NULL -- ambiguous
125
			END);
126 14111 aaronmk
		never_homonym boolean = COALESCE(new."*Author_score" >= 0.6, false);
127 13871 aaronmk
			-- author disambiguates
128
		family_is_homonym boolean = NOT never_homonym
129 14111 aaronmk
			AND "TNRS".family_is_homonym(new."*Family_matched");
130 13871 aaronmk
		genus_is_homonym  boolean = NOT never_homonym
131 14111 aaronmk
			AND "TNRS".genus_is_homonym(new."*Genus_matched");
132 13871 aaronmk
	BEGIN
133
		/* exclude homonyms because these are not valid matches (TNRS provides a
134
		name, but the name is not meaningful because it is not unambiguous) */
135 14111 aaronmk
		new.is_valid_match = new."*Taxonomic_status" != 'Invalid'
136 13871 aaronmk
			AND COALESCE(CASE
137 14111 aaronmk
			WHEN new."*Family_score" = 1 AND NOT family_is_homonym -- exact match
138 13871 aaronmk
				THEN true
139
			ELSE -- consider genus
140 11628 aaronmk
				(CASE
141 14111 aaronmk
				WHEN new."*Genus_score" =  1	   -- exact match
142 13871 aaronmk
					THEN
143
					(CASE
144
					WHEN NOT genus_is_homonym THEN true
145
					ELSE "Specific_epithet_is_plant"
146
					END)
147 14111 aaronmk
				WHEN new."*Genus_score" >= 0.85 -- fuzzy match
148 13871 aaronmk
					THEN "Specific_epithet_is_plant"
149
				ELSE NULL -- ambiguous
150 11628 aaronmk
				END)
151 13871 aaronmk
			END, false);
152
	END;
153 11628 aaronmk
154 13871 aaronmk
	DECLARE
155
		matched_taxon_name_with_author text = NULLIF(concat_ws(' '
156 14111 aaronmk
			, NULLIF(NULLIF(new."*Name_matched_accepted_family", 'Unknown'),
157
				new."*Name_matched")
158
			, NULLIF(new."*Name_matched", 'No suitable matches found.')
159
			, new."*Name_matched_author"
160 13871 aaronmk
			), '');
161
		accepted_taxon_name_with_author text = NULLIF(concat_ws(' '
162 14111 aaronmk
			, NULLIF(NULLIF(new."*Accepted_name_family", 'Unknown'),
163
				new."*Accepted_name")
164
			, new."*Accepted_name"
165
			, new."*Accepted_name_author"
166 13871 aaronmk
			), '');
167
	BEGIN
168
		new.scrubbed_unique_taxon_name = COALESCE(
169
			accepted_taxon_name_with_author, matched_taxon_name_with_author);
170
	END;
171
172 11628 aaronmk
	RETURN new;
173 7134 aaronmk
END;
174 10778 aaronmk
$$;
175
176
177
--
178 13868 aaronmk
-- Name: FUNCTION taxon_match__fill(); Type: COMMENT; Schema: TNRS; Owner: -
179 10778 aaronmk
--
180
181 13868 aaronmk
COMMENT ON FUNCTION taxon_match__fill() IS '
182 13575 aaronmk
IMPORTANT: when changing this function, you must regenerate the derived cols:
183 13861 aaronmk
UPDATE "TNRS".taxon_match SET "Name_submitted" = "Name_submitted"
184 11715 aaronmk
runtime: 30 min ("5564082 rows affected, 1918900 ms execution time")
185 13861 aaronmk
VACUUM ANALYZE "TNRS".taxon_match -- to remove previous rows
186 13575 aaronmk
runtime: 1.5 min ("92633 ms")
187
';
188 7134 aaronmk
189 7251 aaronmk
190 13631 aaronmk
--
191 13868 aaronmk
-- Name: taxon_match__match_num__fill(); Type: FUNCTION; Schema: TNRS; Owner: -
192
--
193
194
CREATE FUNCTION taxon_match__match_num__fill() RETURNS trigger
195
    LANGUAGE plpgsql
196
    AS $$
197
BEGIN
198
	IF new.match_num IS NULL THEN
199 13869 aaronmk
		new.match_num = "TNRS".taxon_match__match_num__next();
200 13868 aaronmk
	END IF;
201
	RETURN new;
202
END;
203
$$;
204
205
206
--
207 13869 aaronmk
-- Name: taxon_match__match_num__next(); Type: FUNCTION; Schema: TNRS; Owner: -
208
--
209
210
CREATE FUNCTION taxon_match__match_num__next() RETURNS bigint
211
    LANGUAGE sql
212
    AS $$
213
SELECT nextval('pg_temp.taxon_match__match_num__seq');
214
$$;
215
216
217
--
218 13868 aaronmk
-- Name: taxon_match_input__copy_to__insert(); Type: FUNCTION; Schema: TNRS; Owner: -
219
--
220
221
CREATE FUNCTION taxon_match_input__copy_to__insert() RETURNS trigger
222
    LANGUAGE plpgsql
223
    AS $$
224
BEGIN
225
	INSERT INTO "TNRS".taxon_match_input SELECT new.*;
226
	RETURN NULL;
227
END;
228
$$;
229
230
231
--
232
-- Name: taxon_name_is_safe(text); Type: FUNCTION; Schema: TNRS; Owner: -
233
--
234
235
CREATE FUNCTION taxon_name_is_safe(taxon_name text) RETURNS boolean
236
    LANGUAGE sql IMMUTABLE
237
    AS $_$
238
SELECT NOT ($1 = ANY("TNRS".unsafe_taxon_names()))
239
$_$;
240
241
242
--
243 13631 aaronmk
-- Name: unsafe_taxon_names(); Type: FUNCTION; Schema: TNRS; Owner: -
244
--
245
246
CREATE FUNCTION unsafe_taxon_names() RETURNS text[]
247
    LANGUAGE sql IMMUTABLE
248
    AS $$
249
SELECT ARRAY[
250 13686 aaronmk
]::text[]
251 13631 aaronmk
$$;
252
253
254 10778 aaronmk
SET default_tablespace = '';
255
256
SET default_with_oids = false;
257
258 10728 aaronmk
--
259 13861 aaronmk
-- Name: taxon_match; Type: TABLE; Schema: TNRS; Owner: -; Tablespace:
260 10778 aaronmk
--
261 7251 aaronmk
262 13861 aaronmk
CREATE TABLE taxon_match (
263 10778 aaronmk
    batch text DEFAULT now() NOT NULL,
264 13580 aaronmk
    match_num integer NOT NULL,
265 14111 aaronmk
    "*Name_number" integer NOT NULL,
266
    "*Name_submitted" text NOT NULL,
267
    "*Overall_score" double precision,
268
    "*Name_matched" text,
269
    "*Name_matched_rank" text,
270
    "*Name_score" double precision,
271
    "*Name_matched_author" text,
272
    "*Name_matched_url" text,
273
    "*Author_matched" text,
274
    "*Author_score" double precision,
275
    "*Family_matched" text,
276
    "*Family_score" double precision,
277
    "*Name_matched_accepted_family" text,
278
    "*Genus_matched" text,
279
    "*Genus_score" double precision,
280
    "*Specific_epithet_matched" text,
281
    "*Specific_epithet_score" double precision,
282
    "*Infraspecific_rank" text,
283
    "*Infraspecific_epithet_matched" text,
284
    "*Infraspecific_epithet_score" double precision,
285
    "*Infraspecific_rank_2" text,
286
    "*Infraspecific_epithet_2_matched" text,
287
    "*Infraspecific_epithet_2_score" double precision,
288
    "*Annotations" text,
289
    "*Unmatched_terms" text,
290
    "*Taxonomic_status" text,
291
    "*Accepted_name" text,
292
    "*Accepted_name_author" text,
293
    "*Accepted_name_rank" text,
294
    "*Accepted_name_url" text,
295
    "*Accepted_name_species" text,
296
    "*Accepted_name_family" text,
297
    "*Selected" text,
298
    "*Source" text,
299
    "*Warnings" text,
300
    "*Accepted_name_lsid" text,
301 11628 aaronmk
    is_valid_match boolean NOT NULL,
302 11632 aaronmk
    scrubbed_unique_taxon_name text
303 10778 aaronmk
);
304 7823 aaronmk
305 9759 aaronmk
306 10778 aaronmk
--
307 13861 aaronmk
-- Name: TABLE taxon_match; Type: COMMENT; Schema: TNRS; Owner: -
308 10778 aaronmk
--
309 7823 aaronmk
310 13861 aaronmk
COMMENT ON TABLE taxon_match IS '
311 13577 aaronmk
to remove columns or add columns at the end:
312
$ rm=1 inputs/.TNRS/data.sql.run
313
$ make schemas/remake
314
315
to add columns in the middle:
316
make the changes in inputs/.TNRS/schema.sql
317
$ inputs/.TNRS/data.sql.run refresh # re-run TNRS
318
$ make schemas/remake
319 13582 aaronmk
320
to populate a new column:
321 13868 aaronmk
ALTER TABLE "TNRS".taxon_match DISABLE TRIGGER taxon_match__fill; --speeds up update
322 13861 aaronmk
UPDATE "TNRS".taxon_match SET "col" = value;
323 13582 aaronmk
	-- runtime: 30 min ("5564201 rows affected, 1624829 ms execution time")
324 13868 aaronmk
ALTER TABLE "TNRS".taxon_match ENABLE TRIGGER taxon_match__fill;
325 13861 aaronmk
VACUUM ANALYZE "TNRS".taxon_match --remove previous rows; runtime: 1.5 min ("92633 ms")
326 13584 aaronmk
327
to add a constraint: runtime: 3 min ("173620 ms")
328 13575 aaronmk
';
329 10778 aaronmk
330
331
--
332 13878 aaronmk
-- Name: taxon_best_match; Type: VIEW; Schema: TNRS; Owner: -
333
--
334
335
CREATE VIEW taxon_best_match AS
336
 SELECT taxon_match.batch,
337
    taxon_match.match_num,
338 14111 aaronmk
    taxon_match."*Name_number",
339
    taxon_match."*Name_submitted",
340
    taxon_match."*Overall_score",
341
    taxon_match."*Name_matched",
342
    taxon_match."*Name_matched_rank",
343
    taxon_match."*Name_score",
344
    taxon_match."*Name_matched_author",
345
    taxon_match."*Name_matched_url",
346
    taxon_match."*Author_matched",
347
    taxon_match."*Author_score",
348
    taxon_match."*Family_matched",
349
    taxon_match."*Family_score",
350
    taxon_match."*Name_matched_accepted_family",
351
    taxon_match."*Genus_matched",
352
    taxon_match."*Genus_score",
353
    taxon_match."*Specific_epithet_matched",
354
    taxon_match."*Specific_epithet_score",
355
    taxon_match."*Infraspecific_rank",
356
    taxon_match."*Infraspecific_epithet_matched",
357
    taxon_match."*Infraspecific_epithet_score",
358
    taxon_match."*Infraspecific_rank_2",
359
    taxon_match."*Infraspecific_epithet_2_matched",
360
    taxon_match."*Infraspecific_epithet_2_score",
361
    taxon_match."*Annotations",
362
    taxon_match."*Unmatched_terms",
363
    taxon_match."*Taxonomic_status",
364
    taxon_match."*Accepted_name",
365
    taxon_match."*Accepted_name_author",
366
    taxon_match."*Accepted_name_rank",
367
    taxon_match."*Accepted_name_url",
368
    taxon_match."*Accepted_name_species",
369
    taxon_match."*Accepted_name_family",
370
    taxon_match."*Selected",
371
    taxon_match."*Source",
372
    taxon_match."*Warnings",
373
    taxon_match."*Accepted_name_lsid",
374 13878 aaronmk
    taxon_match.is_valid_match,
375
    taxon_match.scrubbed_unique_taxon_name
376
   FROM taxon_match
377 14111 aaronmk
  WHERE (taxon_match."*Selected" = 'true'::text);
378 13878 aaronmk
379
380
--
381
-- Name: VIEW taxon_best_match; Type: COMMENT; Schema: TNRS; Owner: -
382
--
383
384
COMMENT ON VIEW taxon_best_match IS '
385
to modify:
386
SELECT util.recreate_view(''"TNRS"."taxon_best_match"'', $$
387
SELECT __
388
$$);
389
';
390
391
392
--
393 10778 aaronmk
-- Name: MatchedTaxon; Type: VIEW; Schema: TNRS; Owner: -
394
--
395
396
CREATE VIEW "MatchedTaxon" AS
397 14110 aaronmk
 SELECT taxon_best_match.batch,
398
    taxon_best_match.match_num,
399 14111 aaronmk
    taxon_best_match."*Name_number",
400
    taxon_best_match."*Name_submitted",
401
    taxon_best_match."*Overall_score",
402
    taxon_best_match."*Name_matched",
403
    taxon_best_match."*Name_matched_rank",
404
    taxon_best_match."*Name_score",
405
    taxon_best_match."*Name_matched_author",
406
    taxon_best_match."*Name_matched_url",
407
    taxon_best_match."*Author_matched",
408
    taxon_best_match."*Author_score",
409
    taxon_best_match."*Family_matched",
410
    taxon_best_match."*Family_score",
411
    taxon_best_match."*Name_matched_accepted_family",
412
    taxon_best_match."*Genus_matched",
413
    taxon_best_match."*Genus_score",
414
    taxon_best_match."*Specific_epithet_matched",
415
    taxon_best_match."*Specific_epithet_score",
416
    taxon_best_match."*Infraspecific_rank",
417
    taxon_best_match."*Infraspecific_epithet_matched",
418
    taxon_best_match."*Infraspecific_epithet_score",
419
    taxon_best_match."*Infraspecific_rank_2",
420
    taxon_best_match."*Infraspecific_epithet_2_matched",
421
    taxon_best_match."*Infraspecific_epithet_2_score",
422
    taxon_best_match."*Annotations",
423
    taxon_best_match."*Unmatched_terms",
424
    taxon_best_match."*Taxonomic_status",
425
    taxon_best_match."*Accepted_name",
426
    taxon_best_match."*Accepted_name_author",
427
    taxon_best_match."*Accepted_name_rank",
428
    taxon_best_match."*Accepted_name_url",
429
    taxon_best_match."*Accepted_name_species",
430
    taxon_best_match."*Accepted_name_family",
431
    taxon_best_match."*Selected",
432
    taxon_best_match."*Source",
433
    taxon_best_match."*Warnings",
434
    taxon_best_match."*Accepted_name_lsid",
435 14110 aaronmk
    taxon_best_match.is_valid_match,
436
    taxon_best_match.scrubbed_unique_taxon_name,
437 14111 aaronmk
    map_taxonomic_status(taxon_best_match."*Taxonomic_status", taxon_best_match."*Accepted_name") AS "taxonomicStatus",
438 13498 aaronmk
        CASE
439 14111 aaronmk
            WHEN (taxon_best_match."*Accepted_name_rank" = 'family'::text) THEN concat_ws(' '::text, taxon_best_match."*Accepted_name_family", taxon_best_match."*Unmatched_terms")
440
            WHEN (taxon_best_match."*Accepted_name_rank" = 'genus'::text) THEN concat_ws(' '::text, taxon_best_match."*Accepted_name", taxon_best_match."*Unmatched_terms")
441
            ELSE taxon_best_match."*Accepted_name_species"
442 13498 aaronmk
        END AS accepted_morphospecies_binomial
443 14110 aaronmk
   FROM taxon_best_match;
444 10778 aaronmk
445
446
--
447 13498 aaronmk
-- Name: VIEW "MatchedTaxon"; Type: COMMENT; Schema: TNRS; Owner: -
448
--
449
450
COMMENT ON VIEW "MatchedTaxon" IS '
451 13501 aaronmk
to modify:
452 13845 aaronmk
SELECT util.recreate_view(''"TNRS"."MatchedTaxon"'', $$
453 13647 aaronmk
SELECT __
454 13501 aaronmk
$$);
455 13498 aaronmk
';
456
457
458
--
459 10778 aaronmk
-- Name: ValidMatchedTaxon; Type: VIEW; Schema: TNRS; Owner: -
460
--
461
462
CREATE VIEW "ValidMatchedTaxon" AS
463 14108 aaronmk
 SELECT "MatchedTaxon".batch,
464 14105 aaronmk
    "MatchedTaxon".match_num,
465 14111 aaronmk
    "MatchedTaxon"."*Name_number",
466
    "MatchedTaxon"."*Name_submitted",
467
    "MatchedTaxon"."*Overall_score",
468
    "MatchedTaxon"."*Name_matched",
469
    "MatchedTaxon"."*Name_matched_rank",
470
    "MatchedTaxon"."*Name_score",
471
    "MatchedTaxon"."*Name_matched_author",
472
    "MatchedTaxon"."*Name_matched_url",
473
    "MatchedTaxon"."*Author_matched",
474
    "MatchedTaxon"."*Author_score",
475
    "MatchedTaxon"."*Family_matched",
476
    "MatchedTaxon"."*Family_score",
477
    "MatchedTaxon"."*Name_matched_accepted_family",
478
    "MatchedTaxon"."*Genus_matched",
479
    "MatchedTaxon"."*Genus_score",
480
    "MatchedTaxon"."*Specific_epithet_matched",
481
    "MatchedTaxon"."*Specific_epithet_score",
482
    "MatchedTaxon"."*Infraspecific_rank",
483
    "MatchedTaxon"."*Infraspecific_epithet_matched",
484
    "MatchedTaxon"."*Infraspecific_epithet_score",
485
    "MatchedTaxon"."*Infraspecific_rank_2",
486
    "MatchedTaxon"."*Infraspecific_epithet_2_matched",
487
    "MatchedTaxon"."*Infraspecific_epithet_2_score",
488
    "MatchedTaxon"."*Annotations",
489
    "MatchedTaxon"."*Unmatched_terms",
490
    "MatchedTaxon"."*Taxonomic_status",
491
    "MatchedTaxon"."*Accepted_name",
492
    "MatchedTaxon"."*Accepted_name_author",
493
    "MatchedTaxon"."*Accepted_name_rank",
494
    "MatchedTaxon"."*Accepted_name_url",
495
    "MatchedTaxon"."*Accepted_name_species",
496
    "MatchedTaxon"."*Accepted_name_family",
497
    "MatchedTaxon"."*Selected",
498
    "MatchedTaxon"."*Source",
499
    "MatchedTaxon"."*Warnings",
500
    "MatchedTaxon"."*Accepted_name_lsid",
501 14108 aaronmk
    "MatchedTaxon".is_valid_match,
502 13800 aaronmk
    "MatchedTaxon".scrubbed_unique_taxon_name,
503 14103 aaronmk
    "MatchedTaxon"."taxonomicStatus",
504 13498 aaronmk
    "MatchedTaxon".accepted_morphospecies_binomial
505 11708 aaronmk
   FROM "MatchedTaxon"
506 14108 aaronmk
  WHERE "MatchedTaxon".is_valid_match;
507 10778 aaronmk
508
509
--
510
-- Name: VIEW "ValidMatchedTaxon"; Type: COMMENT; Schema: TNRS; Owner: -
511
--
512
513 13443 aaronmk
COMMENT ON VIEW "ValidMatchedTaxon" IS '
514
to update, use * as the column list
515
';
516 10778 aaronmk
517
518
--
519
-- Name: batch; Type: TABLE; Schema: TNRS; Owner: -; Tablespace:
520
--
521
522
CREATE TABLE batch (
523
    id text NOT NULL,
524
    id_by_time text,
525
    time_submitted timestamp with time zone DEFAULT now(),
526
    client_version text
527
);
528
529
530
--
531
-- Name: batch_download_settings; Type: TABLE; Schema: TNRS; Owner: -; Tablespace:
532
--
533
534
CREATE TABLE batch_download_settings (
535
    id text NOT NULL,
536
    "E-mail" text,
537
    "Id" text,
538
    "Job type" text,
539
    "Contains Id" boolean,
540
    "Start time" text,
541
    "Finish time" text,
542
    "TNRS version" text,
543
    "Sources selected" text,
544
    "Match threshold" double precision,
545
    "Classification" text,
546
    "Allow partial matches?" boolean,
547
    "Sort by source" boolean,
548
    "Constrain by higher taxonomy" boolean
549
);
550
551
552
--
553
-- Name: TABLE batch_download_settings; Type: COMMENT; Schema: TNRS; Owner: -
554
--
555
556 13575 aaronmk
COMMENT ON TABLE batch_download_settings IS '
557
stores data from http://tnrs.iplantcollaborative.org/TNRSapp.html > Submit List > results section > Download settings > settings.txt
558
';
559 10778 aaronmk
560
561
--
562
-- Name: client_version; Type: TABLE; Schema: TNRS; Owner: -; Tablespace:
563
--
564
565
CREATE TABLE client_version (
566
    id text NOT NULL,
567
    global_rev integer NOT NULL,
568
    "/lib/tnrs.py rev" integer,
569
    "/bin/tnrs_db rev" integer
570
);
571
572
573
--
574
-- Name: TABLE client_version; Type: COMMENT; Schema: TNRS; Owner: -
575
--
576
577 13575 aaronmk
COMMENT ON TABLE client_version IS '
578
contains svn revisions
579
';
580 10778 aaronmk
581
582
--
583
-- Name: COLUMN client_version.global_rev; Type: COMMENT; Schema: TNRS; Owner: -
584
--
585
586 13575 aaronmk
COMMENT ON COLUMN client_version.global_rev IS '
587
from `svn info .` > Last Changed Rev
588
';
589 10778 aaronmk
590
591
--
592
-- Name: COLUMN client_version."/lib/tnrs.py rev"; Type: COMMENT; Schema: TNRS; Owner: -
593
--
594
595 13575 aaronmk
COMMENT ON COLUMN client_version."/lib/tnrs.py rev" IS '
596
from `svn info lib/tnrs.py` > Last Changed Rev
597
';
598 10778 aaronmk
599
600
--
601
-- Name: COLUMN client_version."/bin/tnrs_db rev"; Type: COMMENT; Schema: TNRS; Owner: -
602
--
603
604 13575 aaronmk
COMMENT ON COLUMN client_version."/bin/tnrs_db rev" IS '
605
from `svn info bin/tnrs_db` > Last Changed Rev
606
';
607 10778 aaronmk
608
609
--
610 13866 aaronmk
-- Name: taxon_match_input; Type: VIEW; Schema: TNRS; Owner: -
611
--
612
613
CREATE VIEW taxon_match_input AS
614 14111 aaronmk
 SELECT taxon_match."*Name_number" AS "Name_number",
615
    taxon_match."*Name_submitted" AS "Name_submitted",
616
    taxon_match."*Overall_score" AS "Overall_score",
617
    taxon_match."*Name_matched" AS "Name_matched",
618
    taxon_match."*Name_matched_rank" AS "Name_matched_rank",
619
    taxon_match."*Name_score" AS "Name_score",
620
    taxon_match."*Name_matched_author" AS "Name_matched_author",
621
    taxon_match."*Name_matched_url" AS "Name_matched_url",
622
    taxon_match."*Author_matched" AS "Author_matched",
623
    taxon_match."*Author_score" AS "Author_score",
624
    taxon_match."*Family_matched" AS "Family_matched",
625
    taxon_match."*Family_score" AS "Family_score",
626
    taxon_match."*Name_matched_accepted_family" AS "Name_matched_accepted_family",
627
    taxon_match."*Genus_matched" AS "Genus_matched",
628
    taxon_match."*Genus_score" AS "Genus_score",
629
    taxon_match."*Specific_epithet_matched" AS "Specific_epithet_matched",
630
    taxon_match."*Specific_epithet_score" AS "Specific_epithet_score",
631
    taxon_match."*Infraspecific_rank" AS "Infraspecific_rank",
632
    taxon_match."*Infraspecific_epithet_matched" AS "Infraspecific_epithet_matched",
633
    taxon_match."*Infraspecific_epithet_score" AS "Infraspecific_epithet_score",
634
    taxon_match."*Infraspecific_rank_2" AS "Infraspecific_rank_2",
635
    taxon_match."*Infraspecific_epithet_2_matched" AS "Infraspecific_epithet_2_matched",
636
    taxon_match."*Infraspecific_epithet_2_score" AS "Infraspecific_epithet_2_score",
637
    taxon_match."*Annotations" AS "Annotations",
638
    taxon_match."*Unmatched_terms" AS "Unmatched_terms",
639
    taxon_match."*Taxonomic_status" AS "Taxonomic_status",
640
    taxon_match."*Accepted_name" AS "Accepted_name",
641
    taxon_match."*Accepted_name_author" AS "Accepted_name_author",
642
    taxon_match."*Accepted_name_rank" AS "Accepted_name_rank",
643
    taxon_match."*Accepted_name_url" AS "Accepted_name_url",
644
    taxon_match."*Accepted_name_species" AS "Accepted_name_species",
645
    taxon_match."*Accepted_name_family" AS "Accepted_name_family",
646
    taxon_match."*Selected" AS "Selected",
647
    taxon_match."*Source" AS "Source",
648
    taxon_match."*Warnings" AS "Warnings",
649
    taxon_match."*Accepted_name_lsid" AS "Accepted_name_lsid"
650 13866 aaronmk
   FROM taxon_match;
651
652
653
--
654
-- Name: taxon_match_input__copy_to; Type: TABLE; Schema: TNRS; Owner: -; Tablespace:
655
--
656
657
CREATE TABLE taxon_match_input__copy_to (
658
    "Name_number" integer,
659
    "Name_submitted" text,
660
    "Overall_score" double precision,
661
    "Name_matched" text,
662
    "Name_matched_rank" text,
663
    "Name_score" double precision,
664
    "Name_matched_author" text,
665
    "Name_matched_url" text,
666
    "Author_matched" text,
667
    "Author_score" double precision,
668
    "Family_matched" text,
669
    "Family_score" double precision,
670
    "Name_matched_accepted_family" text,
671
    "Genus_matched" text,
672
    "Genus_score" double precision,
673
    "Specific_epithet_matched" text,
674
    "Specific_epithet_score" double precision,
675
    "Infraspecific_rank" text,
676
    "Infraspecific_epithet_matched" text,
677
    "Infraspecific_epithet_score" double precision,
678
    "Infraspecific_rank_2" text,
679
    "Infraspecific_epithet_2_matched" text,
680
    "Infraspecific_epithet_2_score" double precision,
681
    "Annotations" text,
682
    "Unmatched_terms" text,
683
    "Taxonomic_status" text,
684
    "Accepted_name" text,
685
    "Accepted_name_author" text,
686
    "Accepted_name_rank" text,
687
    "Accepted_name_url" text,
688
    "Accepted_name_species" text,
689
    "Accepted_name_family" text,
690
    "Selected" text,
691
    "Source" text,
692
    "Warnings" text,
693
    "Accepted_name_lsid" text
694
);
695
696
697
--
698 11964 aaronmk
-- Name: taxon_scrub.scrubbed_unique_taxon_name.*; Type: VIEW; Schema: TNRS; Owner: -
699
--
700
701
CREATE VIEW "taxon_scrub.scrubbed_unique_taxon_name.*" AS
702 14111 aaronmk
 SELECT taxon_match."*Name_submitted" AS scrubbed_unique_taxon_name,
703
    taxon_match."*Name_matched_rank" AS scrubbed_taxon_rank,
704
    COALESCE(taxon_match."*Name_matched_accepted_family", taxon_match."*Family_matched") AS scrubbed_family,
705
    taxon_match."*Genus_matched" AS scrubbed_genus,
706
    taxon_match."*Specific_epithet_matched" AS scrubbed_specific_epithet,
707
    taxon_match."*Infraspecific_rank" AS scrubbed_infraspecific_rank,
708
    taxon_match."*Infraspecific_epithet_matched" AS scrubbed_infraspecific_epithet,
709
    taxon_match."*Name_matched_author" AS scrubbed_author,
710
    taxon_match."*Name_matched" AS scrubbed_taxon_name_no_author,
711
    (taxon_match."*Name_matched" || COALESCE((' '::text || taxon_match."*Name_matched_author"), ''::text)) AS scrubbed_taxon_name_with_author
712 13861 aaronmk
   FROM taxon_match;
713 11964 aaronmk
714
715
--
716 11965 aaronmk
-- Name: VIEW "taxon_scrub.scrubbed_unique_taxon_name.*"; Type: COMMENT; Schema: TNRS; Owner: -
717
--
718
719 13575 aaronmk
COMMENT ON VIEW "taxon_scrub.scrubbed_unique_taxon_name.*" IS '
720 13846 aaronmk
to modify:
721
SELECT util.recreate_view(''"TNRS"."taxon_scrub.scrubbed_unique_taxon_name.*"'', $$
722
SELECT __
723
$$);
724
725 13575 aaronmk
scrubbed_family: Name_matched_accepted_family was missing from the TNRS results at one point, so Family_matched is used as a workaround to populate this. the workaround is for *accepted names only*, as no opinion names do not have an Accepted_name_family to prepend to the scrubbed name to parse.
726
';
727 11965 aaronmk
728
729
--
730 11964 aaronmk
-- Name: taxon_scrub; Type: VIEW; Schema: TNRS; Owner: -
731
--
732
733
CREATE VIEW taxon_scrub AS
734 13800 aaronmk
 SELECT "ValidMatchedTaxon".scrubbed_unique_taxon_name,
735 14108 aaronmk
    "ValidMatchedTaxon".batch,
736 14105 aaronmk
    "ValidMatchedTaxon".match_num,
737 14111 aaronmk
    "ValidMatchedTaxon"."*Name_number",
738
    "ValidMatchedTaxon"."*Name_submitted",
739
    "ValidMatchedTaxon"."*Overall_score",
740
    "ValidMatchedTaxon"."*Name_matched",
741
    "ValidMatchedTaxon"."*Name_matched_rank",
742
    "ValidMatchedTaxon"."*Name_score",
743
    "ValidMatchedTaxon"."*Name_matched_author",
744
    "ValidMatchedTaxon"."*Name_matched_url",
745
    "ValidMatchedTaxon"."*Author_matched",
746
    "ValidMatchedTaxon"."*Author_score",
747
    "ValidMatchedTaxon"."*Family_matched",
748
    "ValidMatchedTaxon"."*Family_score",
749
    "ValidMatchedTaxon"."*Name_matched_accepted_family",
750
    "ValidMatchedTaxon"."*Genus_matched",
751
    "ValidMatchedTaxon"."*Genus_score",
752
    "ValidMatchedTaxon"."*Specific_epithet_matched",
753
    "ValidMatchedTaxon"."*Specific_epithet_score",
754
    "ValidMatchedTaxon"."*Infraspecific_rank",
755
    "ValidMatchedTaxon"."*Infraspecific_epithet_matched",
756
    "ValidMatchedTaxon"."*Infraspecific_epithet_score",
757
    "ValidMatchedTaxon"."*Infraspecific_rank_2",
758
    "ValidMatchedTaxon"."*Infraspecific_epithet_2_matched",
759
    "ValidMatchedTaxon"."*Infraspecific_epithet_2_score",
760
    "ValidMatchedTaxon"."*Annotations",
761
    "ValidMatchedTaxon"."*Unmatched_terms",
762
    "ValidMatchedTaxon"."*Taxonomic_status",
763
    "ValidMatchedTaxon"."*Accepted_name",
764
    "ValidMatchedTaxon"."*Accepted_name_author",
765
    "ValidMatchedTaxon"."*Accepted_name_rank",
766
    "ValidMatchedTaxon"."*Accepted_name_url",
767
    "ValidMatchedTaxon"."*Accepted_name_species",
768
    "ValidMatchedTaxon"."*Accepted_name_family",
769
    "ValidMatchedTaxon"."*Selected",
770
    "ValidMatchedTaxon"."*Source",
771
    "ValidMatchedTaxon"."*Warnings",
772
    "ValidMatchedTaxon"."*Accepted_name_lsid",
773 14108 aaronmk
    "ValidMatchedTaxon".is_valid_match,
774 14103 aaronmk
    "ValidMatchedTaxon"."taxonomicStatus",
775 13800 aaronmk
    "ValidMatchedTaxon".accepted_morphospecies_binomial,
776
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank,
777
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family,
778
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_genus,
779
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_specific_epithet,
780
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_infraspecific_rank,
781
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_infraspecific_epithet,
782
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_author,
783
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_no_author,
784
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_with_author,
785 13532 aaronmk
        CASE
786 14111 aaronmk
            WHEN ("taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank = 'family'::text) THEN concat_ws(' '::text, "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family, "ValidMatchedTaxon"."*Unmatched_terms")
787
            WHEN ("taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank = 'genus'::text) THEN concat_ws(' '::text, "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_no_author, "ValidMatchedTaxon"."*Unmatched_terms")
788 13532 aaronmk
            ELSE (("taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_genus || ' '::text) || "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_specific_epithet)
789
        END AS scrubbed_morphospecies_binomial
790 11964 aaronmk
   FROM ("ValidMatchedTaxon"
791
   LEFT JOIN "taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name));
792
793
794
--
795
-- Name: VIEW taxon_scrub; Type: COMMENT; Schema: TNRS; Owner: -
796
--
797
798 13443 aaronmk
COMMENT ON VIEW taxon_scrub IS '
799 13531 aaronmk
to modify:
800 13845 aaronmk
SELECT util.recreate_view(''"TNRS".taxon_scrub'', $$
801 13647 aaronmk
SELECT __
802 13531 aaronmk
$$);
803 13443 aaronmk
';
804 11964 aaronmk
805
806
--
807 10778 aaronmk
-- Name: batch_download_settings_pkey; Type: CONSTRAINT; Schema: TNRS; Owner: -; Tablespace:
808
--
809
810
ALTER TABLE ONLY batch_download_settings
811
    ADD CONSTRAINT batch_download_settings_pkey PRIMARY KEY (id);
812
813
814
--
815
-- Name: batch_id_by_time_key; Type: CONSTRAINT; Schema: TNRS; Owner: -; Tablespace:
816
--
817
818
ALTER TABLE ONLY batch
819
    ADD CONSTRAINT batch_id_by_time_key UNIQUE (id_by_time);
820
821
822
--
823
-- Name: batch_pkey; Type: CONSTRAINT; Schema: TNRS; Owner: -; Tablespace:
824
--
825
826
ALTER TABLE ONLY batch
827
    ADD CONSTRAINT batch_pkey PRIMARY KEY (id);
828
829
830
--
831
-- Name: client_version_pkey; Type: CONSTRAINT; Schema: TNRS; Owner: -; Tablespace:
832
--
833
834
ALTER TABLE ONLY client_version
835
    ADD CONSTRAINT client_version_pkey PRIMARY KEY (id);
836
837
838
--
839 13868 aaronmk
-- Name: taxon_match_pkey; Type: CONSTRAINT; Schema: TNRS; Owner: -; Tablespace:
840 10778 aaronmk
--
841
842 13861 aaronmk
ALTER TABLE ONLY taxon_match
843 13868 aaronmk
    ADD CONSTRAINT taxon_match_pkey PRIMARY KEY (batch, match_num);
844 10778 aaronmk
845
846
--
847 10793 aaronmk
-- Name: batch_client_version_idx; Type: INDEX; Schema: TNRS; Owner: -; Tablespace:
848
--
849
850
CREATE INDEX batch_client_version_idx ON batch USING btree (client_version);
851
852
853
--
854 13879 aaronmk
-- Name: taxon_best_match__valid_match; Type: INDEX; Schema: TNRS; Owner: -; Tablespace:
855 13589 aaronmk
--
856
857 14111 aaronmk
CREATE INDEX taxon_best_match__valid_match ON taxon_match USING btree ("*Name_submitted") WHERE (("*Selected" = 'true'::text) AND is_valid_match);
858 13589 aaronmk
859
860
--
861 13879 aaronmk
-- Name: taxon_match_Name_submitted_idx; Type: INDEX; Schema: TNRS; Owner: -; Tablespace:
862 13874 aaronmk
--
863
864 14111 aaronmk
CREATE INDEX "taxon_match_Name_submitted_idx" ON taxon_match USING btree ("*Name_submitted");
865 13874 aaronmk
866
867
--
868 13879 aaronmk
-- Name: taxon_match__one_selected_match; Type: INDEX; Schema: TNRS; Owner: -; Tablespace:
869 11607 aaronmk
--
870
871 14111 aaronmk
CREATE UNIQUE INDEX taxon_match__one_selected_match ON taxon_match USING btree (batch, "*Name_number") WHERE ("*Selected" = 'true'::text);
872 11607 aaronmk
873
874
--
875 10778 aaronmk
-- Name: batch__fill; Type: TRIGGER; Schema: TNRS; Owner: -
876
--
877
878
CREATE TRIGGER batch__fill BEFORE INSERT OR UPDATE ON batch FOR EACH ROW EXECUTE PROCEDURE batch__fill();
879
880
881
--
882 13868 aaronmk
-- Name: taxon_match__batch_begin; Type: TRIGGER; Schema: TNRS; Owner: -
883 13866 aaronmk
--
884
885 13868 aaronmk
CREATE TRIGGER taxon_match__batch_begin BEFORE INSERT ON taxon_match_input__copy_to FOR EACH STATEMENT EXECUTE PROCEDURE taxon_match__batch_begin();
886 13866 aaronmk
887
888
--
889 13868 aaronmk
-- Name: taxon_match__fill; Type: TRIGGER; Schema: TNRS; Owner: -
890 13567 aaronmk
--
891
892 13868 aaronmk
CREATE TRIGGER taxon_match__fill BEFORE INSERT OR UPDATE ON taxon_match FOR EACH ROW EXECUTE PROCEDURE taxon_match__fill();
893 13567 aaronmk
894
895
--
896 13868 aaronmk
-- Name: taxon_match__match_num__fill; Type: TRIGGER; Schema: TNRS; Owner: -
897 13578 aaronmk
--
898
899 13868 aaronmk
CREATE TRIGGER taxon_match__match_num__fill BEFORE INSERT ON taxon_match FOR EACH ROW EXECUTE PROCEDURE taxon_match__match_num__fill();
900 13578 aaronmk
901
902
--
903 13868 aaronmk
-- Name: taxon_match_input__copy_to__insert; Type: TRIGGER; Schema: TNRS; Owner: -
904 10778 aaronmk
--
905
906 13868 aaronmk
CREATE TRIGGER taxon_match_input__copy_to__insert BEFORE INSERT ON taxon_match_input__copy_to FOR EACH ROW EXECUTE PROCEDURE taxon_match_input__copy_to__insert();
907 10778 aaronmk
908
909
--
910
-- Name: batch_client_version_fkey; Type: FK CONSTRAINT; Schema: TNRS; Owner: -
911
--
912
913
ALTER TABLE ONLY batch
914
    ADD CONSTRAINT batch_client_version_fkey FOREIGN KEY (client_version) REFERENCES client_version(id) ON UPDATE CASCADE ON DELETE CASCADE;
915
916
917
--
918
-- Name: batch_download_settings_id_fkey; Type: FK CONSTRAINT; Schema: TNRS; Owner: -
919
--
920
921
ALTER TABLE ONLY batch_download_settings
922
    ADD CONSTRAINT batch_download_settings_id_fkey FOREIGN KEY (id) REFERENCES batch(id) ON UPDATE CASCADE ON DELETE CASCADE;
923
924
925
--
926 13868 aaronmk
-- Name: taxon_match_batch_fkey; Type: FK CONSTRAINT; Schema: TNRS; Owner: -
927 10778 aaronmk
--
928
929 13861 aaronmk
ALTER TABLE ONLY taxon_match
930 13868 aaronmk
    ADD CONSTRAINT taxon_match_batch_fkey FOREIGN KEY (batch) REFERENCES batch(id) ON UPDATE CASCADE ON DELETE CASCADE;
931 10778 aaronmk
932
933
--
934
-- Name: TNRS; Type: ACL; Schema: -; Owner: -
935
--
936
937
REVOKE ALL ON SCHEMA "TNRS" FROM PUBLIC;
938
REVOKE ALL ON SCHEMA "TNRS" FROM bien;
939
GRANT ALL ON SCHEMA "TNRS" TO bien;
940
GRANT USAGE ON SCHEMA "TNRS" TO bien_read;
941
942
943
--
944 13861 aaronmk
-- Name: taxon_match; Type: ACL; Schema: TNRS; Owner: -
945 10778 aaronmk
--
946
947 13861 aaronmk
REVOKE ALL ON TABLE taxon_match FROM PUBLIC;
948
REVOKE ALL ON TABLE taxon_match FROM bien;
949
GRANT ALL ON TABLE taxon_match TO bien;
950
GRANT SELECT ON TABLE taxon_match TO bien_read;
951 10778 aaronmk
952
953
--
954 13878 aaronmk
-- Name: taxon_best_match; Type: ACL; Schema: TNRS; Owner: -
955
--
956
957
REVOKE ALL ON TABLE taxon_best_match FROM PUBLIC;
958
REVOKE ALL ON TABLE taxon_best_match FROM bien;
959
GRANT ALL ON TABLE taxon_best_match TO bien;
960
GRANT SELECT ON TABLE taxon_best_match TO bien_read;
961
962
963
--
964 11912 aaronmk
-- Name: MatchedTaxon; Type: ACL; Schema: TNRS; Owner: -
965
--
966
967
REVOKE ALL ON TABLE "MatchedTaxon" FROM PUBLIC;
968
REVOKE ALL ON TABLE "MatchedTaxon" FROM bien;
969
GRANT ALL ON TABLE "MatchedTaxon" TO bien;
970
GRANT SELECT ON TABLE "MatchedTaxon" TO bien_read;
971
972
973
--
974
-- Name: ValidMatchedTaxon; Type: ACL; Schema: TNRS; Owner: -
975
--
976
977
REVOKE ALL ON TABLE "ValidMatchedTaxon" FROM PUBLIC;
978
REVOKE ALL ON TABLE "ValidMatchedTaxon" FROM bien;
979
GRANT ALL ON TABLE "ValidMatchedTaxon" TO bien;
980
GRANT SELECT ON TABLE "ValidMatchedTaxon" TO bien_read;
981
982
983
--
984 13866 aaronmk
-- Name: taxon_match_input; Type: ACL; Schema: TNRS; Owner: -
985
--
986
987
REVOKE ALL ON TABLE taxon_match_input FROM PUBLIC;
988
REVOKE ALL ON TABLE taxon_match_input FROM bien;
989
GRANT ALL ON TABLE taxon_match_input TO bien;
990
GRANT SELECT ON TABLE taxon_match_input TO bien_read;
991
992
993
--
994 11912 aaronmk
-- Name: taxon_scrub.scrubbed_unique_taxon_name.*; Type: ACL; Schema: TNRS; Owner: -
995
--
996
997
REVOKE ALL ON TABLE "taxon_scrub.scrubbed_unique_taxon_name.*" FROM PUBLIC;
998
REVOKE ALL ON TABLE "taxon_scrub.scrubbed_unique_taxon_name.*" FROM bien;
999
GRANT ALL ON TABLE "taxon_scrub.scrubbed_unique_taxon_name.*" TO bien;
1000
GRANT SELECT ON TABLE "taxon_scrub.scrubbed_unique_taxon_name.*" TO bien_read;
1001
1002
1003
--
1004
-- Name: taxon_scrub; Type: ACL; Schema: TNRS; Owner: -
1005
--
1006
1007
REVOKE ALL ON TABLE taxon_scrub FROM PUBLIC;
1008
REVOKE ALL ON TABLE taxon_scrub FROM bien;
1009
GRANT ALL ON TABLE taxon_scrub TO bien;
1010
GRANT SELECT ON TABLE taxon_scrub TO bien_read;
1011
1012
1013
--
1014 10778 aaronmk
-- PostgreSQL database dump complete
1015
--