TimescaleDB 安装

版本;

timescaledb-postgresql-12_1.7.2-windows-amd64


前提条件:
1)Visual C++ Redistributable for Visual Studio 2015 (included in VS 2015 and later)  VC++依赖
2)A standard PostgreSQL 12 64-bit installation 首先安装postgresql 11或者12
3)Make sure all relevant binaries are in your PATH: (use pg_config) 确保postgresql的环境变量配置,bin目录配置到path中

安装:
1)下载:https://timescalereleases.blob.core.windows.net/windows/timescaledb-postgresql-12_1.7.2-windows-amd64.zip
2)解压下载文件
3)关闭postgresql服务,运行setup.exe
命令行一步一步执行即可,期间可能要输入配置postgresql.conf文件所在路径,一般在这个目录:
X:\PostgreSQL\12\data


简单使用:
1)创建表:

CREATE TABLE t_test (
  time        TIMESTAMPTZ       NOT NULL,
  location    TEXT              NOT NULL,
  temperature DOUBLE PRECISION  NULL,
  humidity    DOUBLE PRECISION  NULL
);


2) 转为hypertable 

SELECT create_hypertable('t_test', 'time');


3)插入数据

INSERT INTO t_test(time, location, temperature, humidity)
  VALUES (NOW(), 'office', 70.0, 50.0);


4)查看

  SELECT * FROM t_test ORDER BY time DESC LIMIT 100;


  
参考官网:
https://docs.timescale.com/latest/getting-started

你可能感兴趣的:(PostgreSQL)