Project

General

Profile

« Previous | Next » 

Revision 13920

schemas/public_.sql: added in_iucn_red_list()

View differences:

vegbien.sql
2182 2182

  
2183 2183

  
2184 2184
--
2185
-- Name: in_iucn_red_list(text, text, anyelement); Type: FUNCTION; Schema: public; Owner: -
2186
--
2187

  
2188
CREATE FUNCTION in_iucn_red_list(accepted_family text, accepted_species_binomial text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS boolean
2189
    LANGUAGE plpgsql STABLE
2190
    SET search_path TO pg_temp
2191
    AS $$
2192
/* must use LANGUAGE plpgsql because LANGUAGE sql does not support runtime
2193
changes of search_path (schema elements are bound at inline time rather than
2194
runtime) */
2195
/* function option search_path is needed to limit the effects of
2196
`SET LOCAL search_path` to the current function */
2197
DECLARE
2198
	accepted_family_ text = accepted_family;
2199
	accepted_species_binomial_ text = accepted_species_binomial;
2200
BEGIN
2201
	PERFORM util.use_schema(schema_anchor);
2202
	
2203
	RETURN EXISTS(
2204
		SELECT NULL FROM iucn_red_list t
2205
		WHERE
2206
			t.accepted_family = accepted_family_
2207
		AND	t.accepted_species_binomial = accepted_species_binomial_
2208
	);
2209
END;
2210
$$;
2211

  
2212

  
2213
--
2185 2214
-- Name: in_new_world(util.geocoord); Type: FUNCTION; Schema: public; Owner: -
2186 2215
--
2187 2216

  

Also available in: Unified diff