--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- Name: functions; Type: SCHEMA; Schema: -; Owner: -
--

CREATE SCHEMA functions;


SET search_path = functions, pg_catalog;

--
-- Name: _toDouble(); Type: FUNCTION; Schema: functions; Owner: -
--

CREATE FUNCTION "_toDouble"() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
    new.result := CAST(new.value AS double precision);
    RETURN new;
END;
$$;


SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: _toDouble; Type: TABLE; Schema: functions; Owner: -; Tablespace: 
--

CREATE TABLE "_toDouble" (
    result double precision,
    value text
);


--
-- Name: _toDouble_unique; Type: INDEX; Schema: functions; Owner: -; Tablespace: 
--

CREATE UNIQUE INDEX "_toDouble_unique" ON "_toDouble" USING btree ((COALESCE(value, '\\N'::text)));


--
-- Name: _toDouble; Type: TRIGGER; Schema: functions; Owner: -
--

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


--
-- PostgreSQL database dump complete
--

