Revision 12441
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
147 | 147 |
-- |
148 | 148 |
|
149 | 149 |
CREATE FUNCTION _dms_to_dd(value text DEFAULT NULL::text) RETURNS double precision |
150 |
LANGUAGE sql IMMUTABLE STRICT
|
|
150 |
LANGUAGE sql IMMUTABLE |
|
151 | 151 |
AS $_$ |
152 | 152 |
SELECT (g[1]||'1')::integer*util._dms_to_dd(deg := g[2]::double precision, min := g[3]::double precision, sec := g[4]::double precision, dir := g[5]::util.compass_dir) |
153 | 153 |
FROM |
... | ... | |
1744 | 1744 |
-- |
1745 | 1745 |
|
1746 | 1746 |
CREATE FUNCTION join_strs_transform(state text, value text, delim text) RETURNS text |
1747 |
LANGUAGE sql IMMUTABLE STRICT
|
|
1747 |
LANGUAGE sql IMMUTABLE |
|
1748 | 1748 |
AS $_$ |
1749 | 1749 |
SELECT $1 || $3 || $2 |
1750 | 1750 |
$_$; |
... | ... | |
2360 | 2360 |
-- |
2361 | 2361 |
|
2362 | 2362 |
CREATE FUNCTION raise_error_notice(msg text) RETURNS void |
2363 |
LANGUAGE sql IMMUTABLE STRICT
|
|
2363 |
LANGUAGE sql IMMUTABLE |
|
2364 | 2364 |
AS $_$ |
2365 | 2365 |
SELECT util.raise_notice('ERROR: '||$1) |
2366 | 2366 |
$_$; |
trunk/schemas/vegbien.my.sql | ||
---|---|---|
1091 | 1091 |
); |
1092 | 1092 |
|
1093 | 1093 |
|
1094 |
-- |
|
1095 |
-- Name: ~type._plots_01_count_of_projects; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
1096 |
-- |
|
1097 | 1094 |
|
1098 |
CREATE TABLE `~type._plots_01_count_of_projects` ( |
|
1099 |
projects varchar(255) |
|
1100 |
); |
|
1101 | 1095 |
|
1102 |
|
|
1103 | 1096 |
-- |
1104 |
-- Name: ~type._plots_02_list_of_project_names; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
1105 |
-- |
|
1106 |
|
|
1107 |
CREATE TABLE `~type._plots_02_list_of_project_names` ( |
|
1108 |
project_name varchar(255) |
|
1109 |
); |
|
1110 |
|
|
1111 |
|
|
1112 |
|
|
1113 |
|
|
1114 |
-- |
|
1115 | 1097 |
-- Name: analytical_stem; Type: TABLE; Schema: public; Owner: -; Tablespace: |
1116 | 1098 |
-- |
1117 | 1099 |
|
... | ... | |
3923 | 3905 |
|
3924 | 3906 |
|
3925 | 3907 |
-- |
3908 |
-- Name: ~type._plots_01_count_of_projects; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
3909 |
-- |
|
3910 |
|
|
3911 |
CREATE TABLE `~type._plots_01_count_of_projects` ( |
|
3912 |
projects varchar(255) |
|
3913 |
); |
|
3914 |
|
|
3915 |
|
|
3916 |
-- |
|
3917 |
-- Name: ~type._plots_02_list_of_project_names; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
3918 |
-- |
|
3919 |
|
|
3920 |
CREATE TABLE `~type._plots_02_list_of_project_names` ( |
|
3921 |
project_name varchar(255) |
|
3922 |
); |
|
3923 |
|
|
3924 |
|
|
3925 |
-- |
|
3926 | 3926 |
-- Name: ~type._plots_03_count_of_all_plots_in_this_source; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
3927 | 3927 |
-- |
3928 | 3928 |
|
trunk/schemas/vegbien.sql | ||
---|---|---|
466 | 466 |
-- |
467 | 467 |
|
468 | 468 |
CREATE FUNCTION _cm_to_m(value double precision) RETURNS double precision |
469 |
LANGUAGE sql IMMUTABLE STRICT
|
|
469 |
LANGUAGE sql IMMUTABLE |
|
470 | 470 |
AS $_$ |
471 | 471 |
SELECT $1/100. |
472 | 472 |
$_$; |
... | ... | |
477 | 477 |
-- |
478 | 478 |
|
479 | 479 |
CREATE FUNCTION _filter_genus(value text) RETURNS text |
480 |
LANGUAGE sql IMMUTABLE STRICT
|
|
480 |
LANGUAGE sql IMMUTABLE |
|
481 | 481 |
AS $_$ |
482 | 482 |
SELECT (CASE WHEN $1 ~ '\d' THEN NULL ELSE $1 END) |
483 | 483 |
$_$; |
... | ... | |
488 | 488 |
-- |
489 | 489 |
|
490 | 490 |
CREATE FUNCTION _fraction_to_percent(value double precision) RETURNS double precision |
491 |
LANGUAGE sql IMMUTABLE STRICT
|
|
491 |
LANGUAGE sql IMMUTABLE |
|
492 | 492 |
AS $_$ |
493 | 493 |
SELECT $1*100. |
494 | 494 |
$_$; |
... | ... | |
499 | 499 |
-- |
500 | 500 |
|
501 | 501 |
CREATE FUNCTION _ft_to_m(value double precision) RETURNS double precision |
502 |
LANGUAGE sql IMMUTABLE STRICT
|
|
502 |
LANGUAGE sql IMMUTABLE |
|
503 | 503 |
AS $_$ |
504 | 504 |
SELECT _in_to_m($1*12) |
505 | 505 |
$_$; |
... | ... | |
510 | 510 |
-- |
511 | 511 |
|
512 | 512 |
CREATE FUNCTION _ha_to_m2(value double precision) RETURNS double precision |
513 |
LANGUAGE sql IMMUTABLE STRICT
|
|
513 |
LANGUAGE sql IMMUTABLE |
|
514 | 514 |
AS $_$ |
515 | 515 |
SELECT $1*10000. |
516 | 516 |
$_$; |
... | ... | |
521 | 521 |
-- |
522 | 522 |
|
523 | 523 |
CREATE FUNCTION _has_taxonomic_name(rank taxonrank) RETURNS boolean |
524 |
LANGUAGE sql IMMUTABLE STRICT
|
|
524 |
LANGUAGE sql IMMUTABLE |
|
525 | 525 |
AS $_$ |
526 | 526 |
SELECT $1 >= 'family' |
527 | 527 |
$_$; |
... | ... | |
532 | 532 |
-- |
533 | 533 |
|
534 | 534 |
CREATE FUNCTION _in_to_m(value double precision) RETURNS double precision |
535 |
LANGUAGE sql IMMUTABLE STRICT
|
|
535 |
LANGUAGE sql IMMUTABLE |
|
536 | 536 |
AS $_$ |
537 | 537 |
SELECT $1*2.54/100. |
538 | 538 |
$_$; |
... | ... | |
543 | 543 |
-- |
544 | 544 |
|
545 | 545 |
CREATE FUNCTION _km_to_m(value double precision) RETURNS double precision |
546 |
LANGUAGE sql IMMUTABLE STRICT
|
|
546 |
LANGUAGE sql IMMUTABLE |
|
547 | 547 |
AS $_$ |
548 | 548 |
SELECT $1*1000. |
549 | 549 |
$_$; |
... | ... | |
554 | 554 |
-- |
555 | 555 |
|
556 | 556 |
CREATE FUNCTION _locationnarrative_is_cultivated(locationnarrative text) RETURNS boolean |
557 |
LANGUAGE sql IMMUTABLE STRICT
|
|
557 |
LANGUAGE sql IMMUTABLE |
|
558 | 558 |
AS $_$ |
559 | 559 |
SELECT bool_or(value) |
560 | 560 |
FROM |
... | ... | |
588 | 588 |
-- |
589 | 589 |
|
590 | 590 |
CREATE FUNCTION _m2_to_ha(value double precision) RETURNS double precision |
591 |
LANGUAGE sql IMMUTABLE STRICT
|
|
591 |
LANGUAGE sql IMMUTABLE |
|
592 | 592 |
AS $_$ |
593 | 593 |
SELECT $1/10000. |
594 | 594 |
$_$; |
... | ... | |
599 | 599 |
-- |
600 | 600 |
|
601 | 601 |
CREATE FUNCTION _m_to_cm(value double precision) RETURNS double precision |
602 |
LANGUAGE sql IMMUTABLE STRICT
|
|
602 |
LANGUAGE sql IMMUTABLE |
|
603 | 603 |
AS $_$ |
604 | 604 |
SELECT $1*100. |
605 | 605 |
$_$; |
... | ... | |
610 | 610 |
-- |
611 | 611 |
|
612 | 612 |
CREATE FUNCTION _m_to_km(value double precision) RETURNS double precision |
613 |
LANGUAGE sql IMMUTABLE STRICT
|
|
613 |
LANGUAGE sql IMMUTABLE |
|
614 | 614 |
AS $_$ |
615 | 615 |
SELECT $1/1000. |
616 | 616 |
$_$; |
... | ... | |
621 | 621 |
-- |
622 | 622 |
|
623 | 623 |
CREATE FUNCTION _mm_to_m(value double precision) RETURNS double precision |
624 |
LANGUAGE sql IMMUTABLE STRICT
|
|
624 |
LANGUAGE sql IMMUTABLE |
|
625 | 625 |
AS $_$ |
626 | 626 |
SELECT $1/1000. |
627 | 627 |
$_$; |
... | ... | |
661 | 661 |
-- |
662 | 662 |
|
663 | 663 |
CREATE FUNCTION _percent_to_fraction(value double precision) RETURNS double precision |
664 |
LANGUAGE sql IMMUTABLE STRICT
|
|
664 |
LANGUAGE sql IMMUTABLE |
|
665 | 665 |
AS $_$ |
666 | 666 |
SELECT $1/100. |
667 | 667 |
$_$; |
... | ... | |
672 | 672 |
-- |
673 | 673 |
|
674 | 674 |
CREATE FUNCTION _taxon_family_require_std(family text) RETURNS text |
675 |
LANGUAGE sql IMMUTABLE STRICT
|
|
675 |
LANGUAGE sql IMMUTABLE |
|
676 | 676 |
AS $_$ |
677 | 677 |
SELECT (CASE WHEN |
678 | 678 |
lower($1) LIKE '%aceae' |
... | ... | |
705 | 705 |
-- |
706 | 706 |
|
707 | 707 |
CREATE FUNCTION _taxonomic_name_is_epithet(rank taxonrank) RETURNS boolean |
708 |
LANGUAGE sql IMMUTABLE STRICT
|
|
708 |
LANGUAGE sql IMMUTABLE |
|
709 | 709 |
AS $_$ |
710 | 710 |
SELECT $1 <= 'genus' |
711 | 711 |
$_$; |
... | ... | |
2443 | 2443 |
); |
2444 | 2444 |
|
2445 | 2445 |
|
2446 |
-- |
|
2447 |
-- Name: ~type._plots_01_count_of_projects; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
2448 |
-- |
|
2449 |
|
|
2450 |
CREATE TABLE "~type._plots_01_count_of_projects" ( |
|
2451 |
projects bigint |
|
2452 |
); |
|
2453 |
|
|
2454 |
|
|
2455 |
-- |
|
2456 |
-- Name: ~type._plots_02_list_of_project_names; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
2457 |
-- |
|
2458 |
|
|
2459 |
CREATE TABLE "~type._plots_02_list_of_project_names" ( |
|
2460 |
project_name text |
|
2461 |
); |
|
2462 |
|
|
2463 |
|
|
2464 | 2446 |
SET search_path = public, pg_catalog; |
2465 | 2447 |
|
2466 | 2448 |
-- |
... | ... | |
6376 | 6358 |
|
6377 | 6359 |
|
6378 | 6360 |
-- |
6361 |
-- Name: ~type._plots_01_count_of_projects; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
6362 |
-- |
|
6363 |
|
|
6364 |
CREATE TABLE "~type._plots_01_count_of_projects" ( |
|
6365 |
projects bigint |
|
6366 |
); |
|
6367 |
|
|
6368 |
|
|
6369 |
-- |
|
6370 |
-- Name: ~type._plots_02_list_of_project_names; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
6371 |
-- |
|
6372 |
|
|
6373 |
CREATE TABLE "~type._plots_02_list_of_project_names" ( |
|
6374 |
project_name text |
|
6375 |
); |
|
6376 |
|
|
6377 |
|
|
6378 |
-- |
|
6379 | 6379 |
-- Name: ~type._plots_03_count_of_all_plots_in_this_source; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
6380 | 6380 |
-- |
6381 | 6381 |
|
Also available in: Unified diff
schemas/util.sql, vegbien.sql: do not declare IMMUTABLE SQL-language functions as STRICT, because this prevents them from being inlined (as documented in the util schema comment)