Skip to content

Instantly share code, notes, and snippets.

@chrismckelt
Last active April 12, 2020 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismckelt/f4e73f67a6903a1f4a0446065fdc6e78 to your computer and use it in GitHub Desktop.
Save chrismckelt/f4e73f67a6903a1f4a0446065fdc6e78 to your computer and use it in GitHub Desktop.
TimescaleDB.sql
CREATE TABLE IF NOT EXISTS table_001
(
"Timestamp" timestamp with time zone not null,
IsAirConditionerOn smallint not null,
Temperature decimal not null,
tagkey varchar not null
);
ALTER TABLE table_001 OWNER TO postgres;
SELECT create_hypertable ('table_001', 'Timestamp');
-- Grafana access
CREATE USER grafana WITH PASSWORD 'YOUR_PASSWORD' CREATEDB;
CREATE DATABASE grafana OWNER grafana;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment