Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL dump incorrect #34

Open
Noranius opened this issue Apr 10, 2018 · 0 comments
Open

PostgreSQL dump incorrect #34

Noranius opened this issue Apr 10, 2018 · 0 comments

Comments

@Noranius
Copy link

Hi,
i've tried the PostgreSQL dump (contrib/dblog/db_create_postgresql.sql) and had to change it. The problem ist, that the Table will be stored in the schema fhem, due to this has to be accessed via fhem.history. But the device expect only history. A hotfix would be to change the PostgreSQL dump (see below). The better would be to make it parameterizable, i.e. with an attribute.

--
-- 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: current; Type: TABLE; Schema: fhem; Owner: fhem; Tablespace: 
--

CREATE TABLE current (
    "timestamp" timestamp without time zone,
    device character varying(64),
    type character varying(64),
    event character varying(512),
    reading character varying(64),
    value character varying(128),
    unit character varying(32)
);


ALTER TABLE fhem.current OWNER TO fhem;

--
-- Name: history; Type: TABLE; Schema: fhem; Owner: fhem; Tablespace: 
--

CREATE TABLE history (
    "timestamp" timestamp without time zone default CURRENT_TIMESTAMP,
    device character varying(64),
    type character varying(64),
    event character varying(512),
    reading character varying(64),
    value character varying(128),
    unit character varying(32)
);


ALTER TABLE fhem.history OWNER TO fhem;

--
-- Name: reading; Type: INDEX; Schema: fhem; Owner: fhem; Tablespace: 
--

CREATE INDEX "Search_Idx" ON history USING btree (device, reading, "timestamp")

--
-- PostgreSQL database dump complete
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant