Revision 7704
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/functions.sql | ||
---|---|---|
85 | 85 |
|
86 | 86 |
|
87 | 87 |
-- |
88 |
-- Name: _avg(double precision, double precision, double precision, double precision, double precision); Type: FUNCTION; Schema: functions; Owner: - |
|
89 |
-- |
|
90 |
|
|
91 |
CREATE FUNCTION _avg("0" double precision DEFAULT NULL::double precision, "1" double precision DEFAULT NULL::double precision, "2" double precision DEFAULT NULL::double precision, "3" double precision DEFAULT NULL::double precision, "4" double precision DEFAULT NULL::double precision) RETURNS double precision |
|
92 |
LANGUAGE sql IMMUTABLE |
|
93 |
AS $_$ |
|
94 |
SELECT avg(value) |
|
95 |
FROM |
|
96 |
(VALUES |
|
97 |
($1) |
|
98 |
, ($2) |
|
99 |
, ($3) |
|
100 |
, ($4) |
|
101 |
, ($5) |
|
102 |
) |
|
103 |
AS v (value) |
|
104 |
$_$; |
|
105 |
|
|
106 |
|
|
107 |
-- |
|
88 | 108 |
-- Name: _dms_to_dd(text); Type: FUNCTION; Schema: functions; Owner: - |
89 | 109 |
-- |
90 | 110 |
|
lib/xml_func.py | ||
---|---|---|
259 | 259 |
simplifying_funcs['_merge'] = passthru |
260 | 260 |
simplifying_funcs['_min'] = passthru |
261 | 261 |
simplifying_funcs['_max'] = passthru |
262 |
simplifying_funcs['_avg'] = passthru |
|
262 | 263 |
|
263 | 264 |
def _first(node): |
264 | 265 |
'''Chooses the first non-empty param (sorting by numeric param name)''' |
Also available in: Unified diff
schemas/functions.sql: Added _avg()