Project

General

Profile

« Previous | Next » 

Revision 12573

schemas/vegbien.sql: public_validations: auto-added values_() functions for all queries

View differences:

trunk/schemas/vegbien.my.sql
1397 1397

  
1398 1398

  
1399 1399

  
1400
--
1401
-- Name: values_(`~type._plots_01_count_of_projects`); Type: FUNCTION; Schema: public_validations; Owner: -
1402
--
1400 1403

  
1401 1404

  
1405

  
1406

  
1402 1407
--
1408
-- Name: values_(`~type._plots_02_list_of_project_names`); Type: FUNCTION; Schema: public_validations; Owner: -
1409
--
1410

  
1411

  
1412

  
1413

  
1414
--
1415
-- Name: values_(`~type._plots_03_count_of_all_plots_in_this_source`); Type: FUNCTION; Schema: public_validations; Owner: -
1416
--
1417

  
1418

  
1419

  
1420

  
1421
--
1422
-- Name: values_(`~type._plots_04_count_of_plots_in_each_project_in_this_source`); Type: FUNCTION; Schema: public_validations; Owner: -
1423
--
1424

  
1425

  
1426

  
1427

  
1428
--
1429
-- Name: values_(`~type._plots_05_list_of_plot_codes_by_project`); Type: FUNCTION; Schema: public_validations; Owner: -
1430
--
1431

  
1432

  
1433

  
1434

  
1435
--
1436
-- Name: values_(`~type._plots_06_list_of_plots_with_stem_measurements`); Type: FUNCTION; Schema: public_validations; Owner: -
1437
--
1438

  
1439

  
1440

  
1441

  
1442
--
1443
-- Name: values_(`~type._plots_10_count_of_individuals_per_plot_in_each_project`); Type: FUNCTION; Schema: public_validations; Owner: -
1444
--
1445

  
1446

  
1447

  
1448

  
1449
--
1450
-- Name: values_(`~type._plots_11_count_of_stems_per_plot_in_each_project`); Type: FUNCTION; Schema: public_validations; Owner: -
1451
--
1452

  
1453

  
1454

  
1455

  
1456
--
1457
-- Name: values_(`~type._plots_12_count_of_verbatim_taxa_per_plot_in_each_project`); Type: FUNCTION; Schema: public_validations; Owner: -
1458
--
1459

  
1460

  
1461

  
1462

  
1463
--
1464
-- Name: values_(`~type._plots_13_list_of_distinct_verbatim_taxa_in_each_plot_in_`); Type: FUNCTION; Schema: public_validations; Owner: -
1465
--
1466

  
1467

  
1468

  
1469

  
1470
--
1471
-- Name: values_(`~type._plots_14_count_of_indiv_per_verbatim_taxon_per_plot_in_e`); Type: FUNCTION; Schema: public_validations; Owner: -
1472
--
1473

  
1474

  
1475

  
1476

  
1477
--
1478
-- Name: values_(`~type._plots_17_count_of_subplots_per_plot_for_each_project`); Type: FUNCTION; Schema: public_validations; Owner: -
1479
--
1480

  
1481

  
1482

  
1483

  
1484
--
1485
-- Name: values_(`~type._traits_02_count_trait_names`); Type: FUNCTION; Schema: public_validations; Owner: -
1486
--
1487

  
1488

  
1489

  
1490

  
1491
--
1492
-- Name: values_(`~type._traits_03_list_trait_names`); Type: FUNCTION; Schema: public_validations; Owner: -
1493
--
1494

  
1495

  
1496

  
1497

  
1498
--
1499
-- Name: values_(`~type._traits_04_count_records_per_trait`); Type: FUNCTION; Schema: public_validations; Owner: -
1500
--
1501

  
1502

  
1503

  
1504

  
1505
--
1506
-- Name: values_(`~type._traits_05_count_taxa`); Type: FUNCTION; Schema: public_validations; Owner: -
1507
--
1508

  
1509

  
1510

  
1511

  
1512
--
1513
-- Name: values_(`~type._traits_06_list_distinct_taxa`); Type: FUNCTION; Schema: public_validations; Owner: -
1514
--
1515

  
1516

  
1517

  
1518

  
1519
--
1520
-- Name: values_(`~type._traits_07_trait_value_and_units`); Type: FUNCTION; Schema: public_validations; Owner: -
1521
--
1522

  
1523

  
1524

  
1525

  
1526
--
1527
-- Name: values_(`~type._traits_08_taxonname_trait_and_value`); Type: FUNCTION; Schema: public_validations; Owner: -
1528
--
1529

  
1530

  
1531

  
1532

  
1533

  
1534

  
1535
--
1403 1536
-- Name: analytical_stem; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1404 1537
--
1405 1538

  
trunk/schemas/vegbien.sql
2877 2877
$_$;
2878 2878

  
2879 2879

  
2880
--
2881
-- Name: values_("~type._plots_01_count_of_projects"); Type: FUNCTION; Schema: public_validations; Owner: -
2882
--
2883

  
2884
CREATE FUNCTION values_(value "~type._plots_01_count_of_projects", OUT projects bigint) RETURNS bigint
2885
    LANGUAGE sql IMMUTABLE
2886
    AS $_$
2887
SELECT ($1.projects)
2888
$_$;
2889

  
2890

  
2891
--
2892
-- Name: values_("~type._plots_02_list_of_project_names"); Type: FUNCTION; Schema: public_validations; Owner: -
2893
--
2894

  
2895
CREATE FUNCTION values_(value "~type._plots_02_list_of_project_names", OUT project_name text) RETURNS text
2896
    LANGUAGE sql IMMUTABLE
2897
    AS $_$
2898
SELECT ($1.project_name)
2899
$_$;
2900

  
2901

  
2902
--
2903
-- Name: values_("~type._plots_03_count_of_all_plots_in_this_source"); Type: FUNCTION; Schema: public_validations; Owner: -
2904
--
2905

  
2906
CREATE FUNCTION values_(value "~type._plots_03_count_of_all_plots_in_this_source", OUT plots bigint) RETURNS bigint
2907
    LANGUAGE sql IMMUTABLE
2908
    AS $_$
2909
SELECT ($1.plots)
2910
$_$;
2911

  
2912

  
2913
--
2914
-- Name: values_("~type._plots_04_count_of_plots_in_each_project_in_this_source"); Type: FUNCTION; Schema: public_validations; Owner: -
2915
--
2916

  
2917
CREATE FUNCTION values_(value "~type._plots_04_count_of_plots_in_each_project_in_this_source", OUT plots bigint) RETURNS bigint
2918
    LANGUAGE sql IMMUTABLE
2919
    AS $_$
2920
SELECT ($1.plots)
2921
$_$;
2922

  
2923

  
2924
--
2925
-- Name: values_("~type._plots_05_list_of_plot_codes_by_project"); Type: FUNCTION; Schema: public_validations; Owner: -
2926
--
2927

  
2928
CREATE FUNCTION values_(value "~type._plots_05_list_of_plot_codes_by_project", OUT project_name text, OUT plot_code text) RETURNS record
2929
    LANGUAGE sql IMMUTABLE
2930
    AS $_$
2931
SELECT ROW($1.project_name, $1.plot_code)
2932
$_$;
2933

  
2934

  
2935
--
2936
-- Name: values_("~type._plots_06_list_of_plots_with_stem_measurements"); Type: FUNCTION; Schema: public_validations; Owner: -
2937
--
2938

  
2939
CREATE FUNCTION values_(value "~type._plots_06_list_of_plots_with_stem_measurements", OUT project_name text, OUT plot_code text) RETURNS record
2940
    LANGUAGE sql IMMUTABLE
2941
    AS $_$
2942
SELECT ROW($1.project_name, $1.plot_code)
2943
$_$;
2944

  
2945

  
2946
--
2947
-- Name: values_("~type._plots_10_count_of_individuals_per_plot_in_each_project"); Type: FUNCTION; Schema: public_validations; Owner: -
2948
--
2949

  
2950
CREATE FUNCTION values_(value "~type._plots_10_count_of_individuals_per_plot_in_each_project", OUT individuals bigint) RETURNS bigint
2951
    LANGUAGE sql IMMUTABLE
2952
    AS $_$
2953
SELECT ($1.individuals)
2954
$_$;
2955

  
2956

  
2957
--
2958
-- Name: values_("~type._plots_11_count_of_stems_per_plot_in_each_project"); Type: FUNCTION; Schema: public_validations; Owner: -
2959
--
2960

  
2961
CREATE FUNCTION values_(value "~type._plots_11_count_of_stems_per_plot_in_each_project", OUT stems bigint) RETURNS bigint
2962
    LANGUAGE sql IMMUTABLE
2963
    AS $_$
2964
SELECT ($1.stems)
2965
$_$;
2966

  
2967

  
2968
--
2969
-- Name: values_("~type._plots_12_count_of_verbatim_taxa_per_plot_in_each_project"); Type: FUNCTION; Schema: public_validations; Owner: -
2970
--
2971

  
2972
CREATE FUNCTION values_(value "~type._plots_12_count_of_verbatim_taxa_per_plot_in_each_project", OUT taxa bigint) RETURNS bigint
2973
    LANGUAGE sql IMMUTABLE
2974
    AS $_$
2975
SELECT ($1.taxa)
2976
$_$;
2977

  
2978

  
2979
--
2980
-- Name: values_("~type._plots_13_list_of_distinct_verbatim_taxa_in_each_plot_in_"); Type: FUNCTION; Schema: public_validations; Owner: -
2981
--
2982

  
2983
CREATE FUNCTION values_(value "~type._plots_13_list_of_distinct_verbatim_taxa_in_each_plot_in_", OUT project_name text, OUT plot_code text, OUT taxon text) RETURNS record
2984
    LANGUAGE sql IMMUTABLE
2985
    AS $_$
2986
SELECT ROW($1.project_name, $1.plot_code, $1.taxon)
2987
$_$;
2988

  
2989

  
2990
--
2991
-- Name: values_("~type._plots_14_count_of_indiv_per_verbatim_taxon_per_plot_in_e"); Type: FUNCTION; Schema: public_validations; Owner: -
2992
--
2993

  
2994
CREATE FUNCTION values_(value "~type._plots_14_count_of_indiv_per_verbatim_taxon_per_plot_in_e", OUT individuals bigint) RETURNS bigint
2995
    LANGUAGE sql IMMUTABLE
2996
    AS $_$
2997
SELECT ($1.individuals)
2998
$_$;
2999

  
3000

  
3001
--
3002
-- Name: values_("~type._plots_17_count_of_subplots_per_plot_for_each_project"); Type: FUNCTION; Schema: public_validations; Owner: -
3003
--
3004

  
3005
CREATE FUNCTION values_(value "~type._plots_17_count_of_subplots_per_plot_for_each_project", OUT subplots bigint) RETURNS bigint
3006
    LANGUAGE sql IMMUTABLE
3007
    AS $_$
3008
SELECT ($1.subplots)
3009
$_$;
3010

  
3011

  
3012
--
3013
-- Name: values_("~type._traits_02_count_trait_names"); Type: FUNCTION; Schema: public_validations; Owner: -
3014
--
3015

  
3016
CREATE FUNCTION values_(value "~type._traits_02_count_trait_names", OUT traits bigint) RETURNS bigint
3017
    LANGUAGE sql IMMUTABLE
3018
    AS $_$
3019
SELECT ($1.traits)
3020
$_$;
3021

  
3022

  
3023
--
3024
-- Name: values_("~type._traits_03_list_trait_names"); Type: FUNCTION; Schema: public_validations; Owner: -
3025
--
3026

  
3027
CREATE FUNCTION values_(value "~type._traits_03_list_trait_names", OUT trait text) RETURNS text
3028
    LANGUAGE sql IMMUTABLE
3029
    AS $_$
3030
SELECT ($1.trait)
3031
$_$;
3032

  
3033

  
3034
--
3035
-- Name: values_("~type._traits_04_count_records_per_trait"); Type: FUNCTION; Schema: public_validations; Owner: -
3036
--
3037

  
3038
CREATE FUNCTION values_(value "~type._traits_04_count_records_per_trait", OUT measurements bigint) RETURNS bigint
3039
    LANGUAGE sql IMMUTABLE
3040
    AS $_$
3041
SELECT ($1.measurements)
3042
$_$;
3043

  
3044

  
3045
--
3046
-- Name: values_("~type._traits_05_count_taxa"); Type: FUNCTION; Schema: public_validations; Owner: -
3047
--
3048

  
3049
CREATE FUNCTION values_(value "~type._traits_05_count_taxa", OUT taxa bigint) RETURNS bigint
3050
    LANGUAGE sql IMMUTABLE
3051
    AS $_$
3052
SELECT ($1.taxa)
3053
$_$;
3054

  
3055

  
3056
--
3057
-- Name: values_("~type._traits_06_list_distinct_taxa"); Type: FUNCTION; Schema: public_validations; Owner: -
3058
--
3059

  
3060
CREATE FUNCTION values_(value "~type._traits_06_list_distinct_taxa", OUT taxonwithauthor text) RETURNS text
3061
    LANGUAGE sql IMMUTABLE
3062
    AS $_$
3063
SELECT ($1.taxonwithauthor)
3064
$_$;
3065

  
3066

  
3067
--
3068
-- Name: values_("~type._traits_07_trait_value_and_units"); Type: FUNCTION; Schema: public_validations; Owner: -
3069
--
3070

  
3071
CREATE FUNCTION values_(value "~type._traits_07_trait_value_and_units", OUT trait text, OUT value text, OUT units text) RETURNS record
3072
    LANGUAGE sql IMMUTABLE
3073
    AS $_$
3074
SELECT ROW($1.trait, $1.value, $1.units)
3075
$_$;
3076

  
3077

  
3078
--
3079
-- Name: values_("~type._traits_08_taxonname_trait_and_value"); Type: FUNCTION; Schema: public_validations; Owner: -
3080
--
3081

  
3082
CREATE FUNCTION values_(value "~type._traits_08_taxonname_trait_and_value", OUT taxonwithauthor text, OUT trait text, OUT value text) RETURNS record
3083
    LANGUAGE sql IMMUTABLE
3084
    AS $_$
3085
SELECT ROW($1.taxonwithauthor, $1.trait, $1.value)
3086
$_$;
3087

  
3088

  
2880 3089
SET search_path = public, pg_catalog;
2881 3090

  
2882 3091
--

Also available in: Unified diff