Project

General

Profile

« Previous | Next » 

Revision 2951

schemas/py_functions.sql: Added plain functions _dateRangeStart() and _dateRangeEnd() and use them in trigger functions _dateRangeStart() and _dateRangeEnd()

View differences:

schemas/py_functions.sql
28 28
    LANGUAGE plpgsql IMMUTABLE
29 29
    AS $$
30 30
BEGIN
31
    new.result := (SELECT (py_functions.parse_date_range(new.value))[2]);
31
    new.result := py_functions."_dateRangeEnd"(new.value);
32 32
    RETURN new;
33 33
END;
34 34
$$;
......
37 37
ALTER FUNCTION py_functions."_dateRangeEnd"() OWNER TO bien;
38 38

  
39 39
--
40
-- Name: _dateRangeEnd(text); Type: FUNCTION; Schema: py_functions; Owner: bien
41
--
42

  
43
CREATE FUNCTION "_dateRangeEnd"(value text) RETURNS text
44
    LANGUAGE sql IMMUTABLE
45
    AS $_$
46
SELECT (py_functions.parse_date_range($1))[2]
47
$_$;
48

  
49

  
50
ALTER FUNCTION py_functions."_dateRangeEnd"(value text) OWNER TO bien;
51

  
52
--
40 53
-- Name: _dateRangeStart(); Type: FUNCTION; Schema: py_functions; Owner: bien
41 54
--
42 55

  
......
44 57
    LANGUAGE plpgsql IMMUTABLE
45 58
    AS $$
46 59
BEGIN
47
    new.result := (SELECT (py_functions.parse_date_range(new.value))[1]);
60
    new.result := py_functions."_dateRangeStart"(new.value);
48 61
    RETURN new;
49 62
END;
50 63
$$;
......
53 66
ALTER FUNCTION py_functions."_dateRangeStart"() OWNER TO bien;
54 67

  
55 68
--
69
-- Name: _dateRangeStart(text); Type: FUNCTION; Schema: py_functions; Owner: bien
70
--
71

  
72
CREATE FUNCTION "_dateRangeStart"(value text) RETURNS text
73
    LANGUAGE sql IMMUTABLE
74
    AS $_$
75
SELECT (py_functions.parse_date_range($1))[1]
76
$_$;
77

  
78

  
79
ALTER FUNCTION py_functions."_dateRangeStart"(value text) OWNER TO bien;
80

  
81
--
56 82
-- Name: _namePart(); Type: FUNCTION; Schema: py_functions; Owner: bien
57 83
--
58 84

  

Also available in: Unified diff