Project

General

Profile

« Previous | Next » 

Revision 13925

bugfix: schemas/public_.sql: wrapper functions can't use util-schema types because these will cause the wrapper function to be cascadingly dropped when the util schema is reinstalled

View differences:

vegbien.sql
2212 2212

  
2213 2213

  
2214 2214
--
2215
-- Name: in_new_world(util.geocoord); Type: FUNCTION; Schema: public; Owner: -
2215
-- Name: in_new_world(double precision, double precision); Type: FUNCTION; Schema: public; Owner: -
2216 2216
--
2217 2217

  
2218
CREATE FUNCTION in_new_world(point util.geocoord) RETURNS boolean
2218
CREATE FUNCTION in_new_world(latitude_deg double precision, longitude_deg double precision) RETURNS boolean
2219 2219
    LANGUAGE sql IMMUTABLE
2220 2220
    AS $_$
2221
SELECT util.in_new_world($1)
2221
SELECT util.in_new_world(($1, $2))
2222 2222
$_$;
2223 2223

  
2224 2224

  
2225 2225
--
2226
-- Name: FUNCTION in_new_world(point util.geocoord); Type: COMMENT; Schema: public; Owner: -
2226
-- Name: FUNCTION in_new_world(latitude_deg double precision, longitude_deg double precision); Type: COMMENT; Schema: public; Owner: -
2227 2227
--
2228 2228

  
2229
COMMENT ON FUNCTION in_new_world(point util.geocoord) IS '
2229
COMMENT ON FUNCTION in_new_world(latitude_deg double precision, longitude_deg double precision) IS '
2230 2230
wrapper that prevents views from getting dropped when the util schema is reinstalled
2231 2231
';
2232 2232

  
2233 2233

  
2234 2234
--
2235
-- Name: in_south_america(util.geocoord); Type: FUNCTION; Schema: public; Owner: -
2235
-- Name: in_south_america(double precision, double precision); Type: FUNCTION; Schema: public; Owner: -
2236 2236
--
2237 2237

  
2238
CREATE FUNCTION in_south_america(point util.geocoord) RETURNS boolean
2238
CREATE FUNCTION in_south_america(latitude_deg double precision, longitude_deg double precision) RETURNS boolean
2239 2239
    LANGUAGE sql IMMUTABLE
2240 2240
    AS $_$
2241
SELECT util.in_south_america($1)
2241
SELECT util.in_south_america(($1, $2))
2242 2242
$_$;
2243 2243

  
2244 2244

  
2245 2245
--
2246
-- Name: FUNCTION in_south_america(point util.geocoord); Type: COMMENT; Schema: public; Owner: -
2246
-- Name: FUNCTION in_south_america(latitude_deg double precision, longitude_deg double precision); Type: COMMENT; Schema: public; Owner: -
2247 2247
--
2248 2248

  
2249
COMMENT ON FUNCTION in_south_america(point util.geocoord) IS '
2249
COMMENT ON FUNCTION in_south_america(latitude_deg double precision, longitude_deg double precision) IS '
2250 2250
wrapper that prevents views from getting dropped when the util schema is reinstalled
2251 2251
';
2252 2252

  
......
6142 6142
    analytical_stem.scrubbed_species_binomial AS "speciesBinomial",
6143 6143
    analytical_stem.scrubbed_taxon_name_with_author AS "scientificName"
6144 6144
   FROM analytical_stem
6145
  WHERE ((((((COALESCE((analytical_stem.geovalid_bien)::boolean, true) AND (COALESCE((analytical_stem."isNewWorld_bien")::boolean, false) OR in_new_world(ROW(analytical_stem."decimalLatitude__@DwC__@vegpath.org", analytical_stem."decimalLongitude__@DwC__@vegpath.org")))) AND (NOT COALESCE((analytical_stem.cultivated_bien)::boolean, false))) AND (analytical_stem.scrubbed_family IS NOT NULL)) AND (analytical_stem."decimalLatitude__@DwC__@vegpath.org" IS NOT NULL)) AND (analytical_stem."decimalLongitude__@DwC__@vegpath.org" IS NOT NULL)) AND COALESCE((analytical_stem."coordinateUncertaintyInMeters__@DwC__@vegpath.org" <= _km_to_m((10)::double precision)), true));
6145
  WHERE ((((((COALESCE((analytical_stem.geovalid_bien)::boolean, true) AND (COALESCE((analytical_stem."isNewWorld_bien")::boolean, false) OR in_new_world(analytical_stem."decimalLatitude__@DwC__@vegpath.org", analytical_stem."decimalLongitude__@DwC__@vegpath.org"))) AND (NOT COALESCE((analytical_stem.cultivated_bien)::boolean, false))) AND (analytical_stem.scrubbed_family IS NOT NULL)) AND (analytical_stem."decimalLatitude__@DwC__@vegpath.org" IS NOT NULL)) AND (analytical_stem."decimalLongitude__@DwC__@vegpath.org" IS NOT NULL)) AND COALESCE((analytical_stem."coordinateUncertaintyInMeters__@DwC__@vegpath.org" <= _km_to_m((10)::double precision)), true));
6146 6146

  
6147 6147

  
6148 6148
--
......
6165 6165
    analytical_stem."[growth_form=]habit__@SALVIAS__.Plot_data@vegpath.org" AS lifeform,
6166 6166
    in_iucn_red_list(analytical_stem.scrubbed_family, analytical_stem.scrubbed_species_binomial) AS is_threatened_iucn
6167 6167
   FROM analytical_stem
6168
  WHERE (((((COALESCE((analytical_stem.geovalid_bien)::boolean, true) AND (NOT COALESCE((analytical_stem.cultivated_bien)::boolean, false))) AND (analytical_stem."decimalLatitude__@DwC__@vegpath.org" IS NOT NULL)) AND (analytical_stem."decimalLongitude__@DwC__@vegpath.org" IS NOT NULL)) AND in_south_america(ROW(analytical_stem."decimalLatitude__@DwC__@vegpath.org", analytical_stem."decimalLongitude__@DwC__@vegpath.org"))) AND COALESCE((analytical_stem."taxonomicStatus__@DwC__@vegpath.org" = 'accepted'::text), false));
6168
  WHERE (((((COALESCE((analytical_stem.geovalid_bien)::boolean, true) AND (NOT COALESCE((analytical_stem.cultivated_bien)::boolean, false))) AND (analytical_stem."decimalLatitude__@DwC__@vegpath.org" IS NOT NULL)) AND (analytical_stem."decimalLongitude__@DwC__@vegpath.org" IS NOT NULL)) AND in_south_america(analytical_stem."decimalLatitude__@DwC__@vegpath.org", analytical_stem."decimalLongitude__@DwC__@vegpath.org")) AND COALESCE((analytical_stem."taxonomicStatus__@DwC__@vegpath.org" = 'accepted'::text), false));
6169 6169

  
6170 6170

  
6171 6171
--

Also available in: Unified diff