5179 |
5179 |
ALTER SEQUENCE voucher_voucher_id_seq OWNED BY voucher.voucher_id;
|
5180 |
5180 |
|
5181 |
5181 |
|
|
5182 |
SET search_path = public_validation_traits, pg_catalog;
|
|
5183 |
|
5182 |
5184 |
--
|
|
5185 |
-- Name: _01_count_records; Type: VIEW; Schema: public_validation_traits; Owner: -
|
|
5186 |
--
|
|
5187 |
|
|
5188 |
CREATE VIEW _01_count_records AS
|
|
5189 |
SELECT count(*) AS "totalRecords"
|
|
5190 |
FROM (public.trait
|
|
5191 |
JOIN public.taxonoccurrence USING (taxonoccurrence_id))
|
|
5192 |
WHERE (taxonoccurrence.source_id = public.source_by_shortname(("current_schema"())::text));
|
|
5193 |
|
|
5194 |
|
|
5195 |
--
|
|
5196 |
-- Name: _02_count_trait_names; Type: VIEW; Schema: public_validation_traits; Owner: -
|
|
5197 |
--
|
|
5198 |
|
|
5199 |
CREATE VIEW _02_count_trait_names AS
|
|
5200 |
SELECT count(DISTINCT trait.name) AS traits
|
|
5201 |
FROM (public.trait
|
|
5202 |
JOIN public.taxonoccurrence USING (taxonoccurrence_id))
|
|
5203 |
WHERE (taxonoccurrence.source_id = public.source_by_shortname(("current_schema"())::text));
|
|
5204 |
|
|
5205 |
|
|
5206 |
--
|
|
5207 |
-- Name: _03_list_trait_names; Type: VIEW; Schema: public_validation_traits; Owner: -
|
|
5208 |
--
|
|
5209 |
|
|
5210 |
CREATE VIEW _03_list_trait_names AS
|
|
5211 |
SELECT DISTINCT trait.name AS trait
|
|
5212 |
FROM (public.trait
|
|
5213 |
JOIN public.taxonoccurrence USING (taxonoccurrence_id))
|
|
5214 |
WHERE (taxonoccurrence.source_id = public.source_by_shortname(("current_schema"())::text))
|
|
5215 |
ORDER BY trait.name;
|
|
5216 |
|
|
5217 |
|
|
5218 |
--
|
|
5219 |
-- Name: _04_count_records_per_trait; Type: VIEW; Schema: public_validation_traits; Owner: -
|
|
5220 |
--
|
|
5221 |
|
|
5222 |
CREATE VIEW _04_count_records_per_trait AS
|
|
5223 |
SELECT trait.name AS trait,
|
|
5224 |
count(*) AS measurements
|
|
5225 |
FROM (public.trait
|
|
5226 |
JOIN public.taxonoccurrence USING (taxonoccurrence_id))
|
|
5227 |
WHERE (taxonoccurrence.source_id = public.source_by_shortname(("current_schema"())::text))
|
|
5228 |
GROUP BY trait.name
|
|
5229 |
ORDER BY trait.name;
|
|
5230 |
|
|
5231 |
|
|
5232 |
--
|
|
5233 |
-- Name: _05_count_taxa; Type: VIEW; Schema: public_validation_traits; Owner: -
|
|
5234 |
--
|
|
5235 |
|
|
5236 |
CREATE VIEW _05_count_taxa AS
|
|
5237 |
SELECT count(DISTINCT ROW(taxonverbatim.taxonname, taxonverbatim.author)) AS taxa
|
|
5238 |
FROM public.taxonverbatim
|
|
5239 |
WHERE (taxonverbatim.source_id = public.source_by_shortname(("current_schema"())::text));
|
|
5240 |
|
|
5241 |
|
|
5242 |
--
|
|
5243 |
-- Name: _06_list_taxa; Type: VIEW; Schema: public_validation_traits; Owner: -
|
|
5244 |
--
|
|
5245 |
|
|
5246 |
CREATE VIEW _06_list_taxa AS
|
|
5247 |
SELECT DISTINCT concat_ws(' '::text, taxonverbatim.taxonname, taxonverbatim.author) AS taxonwithauthor
|
|
5248 |
FROM public.taxonverbatim
|
|
5249 |
WHERE (taxonverbatim.source_id = public.source_by_shortname(("current_schema"())::text))
|
|
5250 |
ORDER BY concat_ws(' '::text, taxonverbatim.taxonname, taxonverbatim.author);
|
|
5251 |
|
|
5252 |
|
|
5253 |
--
|
|
5254 |
-- Name: _07_trait_value_and_units_for_first_5000_records; Type: VIEW; Schema: public_validation_traits; Owner: -
|
|
5255 |
--
|
|
5256 |
|
|
5257 |
CREATE VIEW _07_trait_value_and_units_for_first_5000_records AS
|
|
5258 |
SELECT trait.name AS trait,
|
|
5259 |
trait.value,
|
|
5260 |
trait.units
|
|
5261 |
FROM (public.trait
|
|
5262 |
JOIN public.taxonoccurrence USING (taxonoccurrence_id))
|
|
5263 |
WHERE (taxonoccurrence.source_id = public.source_by_shortname(("current_schema"())::text))
|
|
5264 |
ORDER BY trait.name, trait.value, trait.units
|
|
5265 |
LIMIT 5000;
|
|
5266 |
|
|
5267 |
|
|
5268 |
--
|
|
5269 |
-- Name: _08_taxon_trait_and_value_for_first_5000_records; Type: VIEW; Schema: public_validation_traits; Owner: -
|
|
5270 |
--
|
|
5271 |
|
|
5272 |
CREATE VIEW _08_taxon_trait_and_value_for_first_5000_records AS
|
|
5273 |
SELECT concat_ws(' '::text, taxonverbatim.taxonname, taxonverbatim.author) AS taxonwithauthor,
|
|
5274 |
trait.name AS trait,
|
|
5275 |
trait.value
|
|
5276 |
FROM ((public.taxonverbatim
|
|
5277 |
JOIN public.taxondetermination ON (((taxondetermination.taxonverbatim_id = taxonverbatim.taxonverbatim_id) AND taxondetermination.iscurrent)))
|
|
5278 |
JOIN public.trait USING (taxonoccurrence_id))
|
|
5279 |
WHERE (taxonverbatim.source_id = public.source_by_shortname(("current_schema"())::text))
|
|
5280 |
ORDER BY taxonverbatim.taxonname
|
|
5281 |
LIMIT 5000;
|
|
5282 |
|
|
5283 |
|
|
5284 |
SET search_path = public, pg_catalog;
|
|
5285 |
|
|
5286 |
--
|
5183 |
5287 |
-- Name: address_id; Type: DEFAULT; Schema: public; Owner: -
|
5184 |
5288 |
--
|
5185 |
5289 |
|
schemas/vegbien.sql: public_validation_traits: populated queries from validation/aggregating/traits/bien3_validations_traits_bien3.sql