Revision 5844
Added by Aaron Marcuse-Kubitza about 12 years ago
schemas/vegbien.my.sql | ||
---|---|---|
138 | 138 |
|
139 | 139 |
|
140 | 140 |
-- |
141 |
-- Name: _ft_to_m(double precision); Type: FUNCTION; Schema: public; Owner: - |
|
142 |
-- |
|
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
|
147 |
-- |
|
148 |
-- Name: _ha_to_m2(double precision); Type: FUNCTION; Schema: public; Owner: - |
|
149 |
-- |
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
|
154 |
-- |
|
141 | 155 |
-- Name: _has_taxonomic_name(taxonrank); Type: FUNCTION; Schema: public; Owner: - |
142 | 156 |
-- |
143 | 157 |
|
... | ... | |
145 | 159 |
|
146 | 160 |
|
147 | 161 |
-- |
162 |
-- Name: _in_to_m(double precision); Type: FUNCTION; Schema: public; Owner: - |
|
163 |
-- |
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
-- |
|
148 | 169 |
-- Name: _m2_to_ha(double precision); Type: FUNCTION; Schema: public; Owner: - |
149 | 170 |
-- |
150 | 171 |
|
... | ... | |
159 | 180 |
|
160 | 181 |
|
161 | 182 |
-- |
183 |
-- Name: _percent_to_fraction(double precision); Type: FUNCTION; Schema: public; Owner: - |
|
184 |
-- |
|
185 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
-- |
|
162 | 190 |
-- Name: _taxon_family_require_std(text); Type: FUNCTION; Schema: public; Owner: - |
163 | 191 |
-- |
164 | 192 |
|
schemas/functions.sql | ||
---|---|---|
47 | 47 |
|
48 | 48 |
|
49 | 49 |
-- |
50 |
-- Name: _cm_to_m(double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
51 |
-- |
|
52 |
|
|
53 |
CREATE FUNCTION _cm_to_m(value double precision) RETURNS double precision |
|
54 |
LANGUAGE sql IMMUTABLE STRICT |
|
55 |
AS $_$ |
|
56 |
SELECT $1/100. |
|
57 |
$_$; |
|
58 |
|
|
59 |
|
|
60 |
-- |
|
61 | 50 |
-- Name: _eq(anyelement, anyelement); Type: FUNCTION; Schema: functions; Owner: - |
62 | 51 |
-- |
63 | 52 |
|
... | ... | |
69 | 58 |
|
70 | 59 |
|
71 | 60 |
-- |
72 |
-- Name: _fraction_to_percent(double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
73 |
-- |
|
74 |
|
|
75 |
CREATE FUNCTION _fraction_to_percent(value double precision) RETURNS double precision |
|
76 |
LANGUAGE sql IMMUTABLE STRICT |
|
77 |
AS $_$ |
|
78 |
SELECT $1*100. |
|
79 |
$_$; |
|
80 |
|
|
81 |
|
|
82 |
-- |
|
83 |
-- Name: _ft_to_m(double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
84 |
-- |
|
85 |
|
|
86 |
CREATE FUNCTION _ft_to_m(value double precision) RETURNS double precision |
|
87 |
LANGUAGE sql IMMUTABLE STRICT |
|
88 |
AS $_$ |
|
89 |
SELECT functions._in_to_m($1*12) |
|
90 |
$_$; |
|
91 |
|
|
92 |
|
|
93 |
-- |
|
94 |
-- Name: _ha_to_m2(double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
95 |
-- |
|
96 |
|
|
97 |
CREATE FUNCTION _ha_to_m2(value double precision) RETURNS double precision |
|
98 |
LANGUAGE sql IMMUTABLE STRICT |
|
99 |
AS $_$ |
|
100 |
SELECT $1*10000. |
|
101 |
$_$; |
|
102 |
|
|
103 |
|
|
104 |
-- |
|
105 | 61 |
-- Name: _if(boolean, anyelement, anyelement); Type: FUNCTION; Schema: functions; Owner: - |
106 | 62 |
-- |
107 | 63 |
|
... | ... | |
124 | 80 |
|
125 | 81 |
|
126 | 82 |
-- |
127 |
-- Name: _in_to_m(double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
128 |
-- |
|
129 |
|
|
130 |
CREATE FUNCTION _in_to_m(value double precision) RETURNS double precision |
|
131 |
LANGUAGE sql IMMUTABLE STRICT |
|
132 |
AS $_$ |
|
133 |
SELECT $1*2.54/100. |
|
134 |
$_$; |
|
135 |
|
|
136 |
|
|
137 |
-- |
|
138 | 83 |
-- Name: _join(anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement); Type: FUNCTION; Schema: functions; Owner: - |
139 | 84 |
-- |
140 | 85 |
|
... | ... | |
168 | 113 |
|
169 | 114 |
|
170 | 115 |
-- |
171 |
-- Name: _m2_to_ha(double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
172 |
-- |
|
173 |
|
|
174 |
CREATE FUNCTION _m2_to_ha(value double precision) RETURNS double precision |
|
175 |
LANGUAGE sql IMMUTABLE STRICT |
|
176 |
AS $_$ |
|
177 |
SELECT $1/10000. |
|
178 |
$_$; |
|
179 |
|
|
180 |
|
|
181 |
-- |
|
182 |
-- Name: _m_to_cm(double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
183 |
-- |
|
184 |
|
|
185 |
CREATE FUNCTION _m_to_cm(value double precision) RETURNS double precision |
|
186 |
LANGUAGE sql IMMUTABLE STRICT |
|
187 |
AS $_$ |
|
188 |
SELECT $1*100. |
|
189 |
$_$; |
|
190 |
|
|
191 |
|
|
192 |
-- |
|
193 | 116 |
-- Name: _max(anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement); Type: FUNCTION; Schema: functions; Owner: - |
194 | 117 |
-- |
195 | 118 |
|
... | ... | |
317 | 240 |
|
318 | 241 |
|
319 | 242 |
-- |
320 |
-- Name: _percent_to_fraction(double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
321 |
-- |
|
322 |
|
|
323 |
CREATE FUNCTION _percent_to_fraction(value double precision) RETURNS double precision |
|
324 |
LANGUAGE sql IMMUTABLE STRICT |
|
325 |
AS $_$ |
|
326 |
SELECT $1/100. |
|
327 |
$_$; |
|
328 |
|
|
329 |
|
|
330 |
-- |
|
331 | 243 |
-- Name: join_strs_transform(text, text, text); Type: FUNCTION; Schema: functions; Owner: - |
332 | 244 |
-- |
333 | 245 |
|
schemas/vegbien.sql | ||
---|---|---|
312 | 312 |
|
313 | 313 |
|
314 | 314 |
-- |
315 |
-- Name: _ft_to_m(double precision); Type: FUNCTION; Schema: public; Owner: - |
|
316 |
-- |
|
317 |
|
|
318 |
CREATE FUNCTION _ft_to_m(value double precision) RETURNS double precision |
|
319 |
LANGUAGE sql IMMUTABLE STRICT |
|
320 |
AS $_$ |
|
321 |
SELECT _in_to_m($1*12) |
|
322 |
$_$; |
|
323 |
|
|
324 |
|
|
325 |
-- |
|
326 |
-- Name: _ha_to_m2(double precision); Type: FUNCTION; Schema: public; Owner: - |
|
327 |
-- |
|
328 |
|
|
329 |
CREATE FUNCTION _ha_to_m2(value double precision) RETURNS double precision |
|
330 |
LANGUAGE sql IMMUTABLE STRICT |
|
331 |
AS $_$ |
|
332 |
SELECT $1*10000. |
|
333 |
$_$; |
|
334 |
|
|
335 |
|
|
336 |
-- |
|
315 | 337 |
-- Name: _has_taxonomic_name(taxonrank); Type: FUNCTION; Schema: public; Owner: - |
316 | 338 |
-- |
317 | 339 |
|
... | ... | |
323 | 345 |
|
324 | 346 |
|
325 | 347 |
-- |
348 |
-- Name: _in_to_m(double precision); Type: FUNCTION; Schema: public; Owner: - |
|
349 |
-- |
|
350 |
|
|
351 |
CREATE FUNCTION _in_to_m(value double precision) RETURNS double precision |
|
352 |
LANGUAGE sql IMMUTABLE STRICT |
|
353 |
AS $_$ |
|
354 |
SELECT $1*2.54/100. |
|
355 |
$_$; |
|
356 |
|
|
357 |
|
|
358 |
-- |
|
326 | 359 |
-- Name: _m2_to_ha(double precision); Type: FUNCTION; Schema: public; Owner: - |
327 | 360 |
-- |
328 | 361 |
|
... | ... | |
345 | 378 |
|
346 | 379 |
|
347 | 380 |
-- |
381 |
-- Name: _percent_to_fraction(double precision); Type: FUNCTION; Schema: public; Owner: - |
|
382 |
-- |
|
383 |
|
|
384 |
CREATE FUNCTION _percent_to_fraction(value double precision) RETURNS double precision |
|
385 |
LANGUAGE sql IMMUTABLE STRICT |
|
386 |
AS $_$ |
|
387 |
SELECT $1/100. |
|
388 |
$_$; |
|
389 |
|
|
390 |
|
|
391 |
-- |
|
348 | 392 |
-- Name: _taxon_family_require_std(text); Type: FUNCTION; Schema: public; Owner: - |
349 | 393 |
-- |
350 | 394 |
|
Also available in: Unified diff
schemas/: Moved unit conversion functions from functions.sql to vegbien.sql so the unit conversion functions used by analytical_db_view wouldn't need to be stored both in functions.sql and in vegbien.sql. (All unit conversion functions used by analytical_db_view must be stored in the public schema so that analytical_db_view doesn't get cascadingly deleted when the functions schema is reinstalled.)