Project

General

Profile

« Previous | Next » 

Revision 2136

schemas/functions.sql: Added _toBool

View differences:

functions.sql
64 64
-- PostgreSQL database dump complete
65 65
--
66 66

  
67

  
68
--
69
-- Name: _toBool(); Type: FUNCTION; Schema: functions; Owner: -
70
--
71

  
72
CREATE FUNCTION "_toBool"() RETURNS trigger
73
    LANGUAGE plpgsql IMMUTABLE
74
    AS $$
75
BEGIN
76
    new.result := CAST(new.value AS boolean);
77
    RETURN new;
78
END;
79
$$;
80

  
81

  
82
SET default_tablespace = '';
83

  
84
SET default_with_oids = false;
85

  
86
--
87
-- Name: _toBool; Type: TABLE; Schema: functions; Owner: -; Tablespace: 
88
--
89

  
90
CREATE TABLE "_toBool" (
91
    result boolean,
92
    value text
93
);
94

  
95

  
96
--
97
-- Name: _toBool_unique; Type: INDEX; Schema: functions; Owner: -; Tablespace: 
98
--
99

  
100
CREATE UNIQUE INDEX "_toBool_unique" ON "_toBool" USING btree ((COALESCE(value, '\\N'::text)));
101

  
102

  
103
--
104
-- Name: _toBool; Type: TRIGGER; Schema: functions; Owner: -
105
--
106

  
107
CREATE TRIGGER "_toBool" BEFORE INSERT OR UPDATE ON "_toBool" FOR EACH ROW EXECUTE PROCEDURE "_toBool"();
108

  
109

  
110
--
111
-- PostgreSQL database dump complete
112
--
113

  

Also available in: Unified diff