timescaledb
timescaledb
timescaledb : Enables scalable inserts and complex queries for time-series data
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 1000 | timescaledb | timescaledb | 2.23.0 | TIME | Timescale | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--sLd-- | No | Yes | Yes | Yes | no | no |
| Relationships | |
|---|---|
| See Also | timescaledb_toolkit timeseries pg_cron pg_partman periods temporal_tables emaj pg_task |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 2.23.0 | 18 17 16 15 14 13 | timescaledb | - |
| RPM | PIGSTY | 2.23.0 | 18 17 16 15 14 13 | timescaledb-tsl_$v* | - |
| DEB | PIGSTY | 2.23.0 | 18 17 16 15 14 13 | postgresql-$v-timescaledb-tsl | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 | PG13 |
|---|---|---|---|---|---|---|
el8.x86_64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PGDG 2.9.3 | PGDG 2.9.3 |
el8.aarch64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.19.3 | MISS |
el9.x86_64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PGDG 2.9.3 | PGDG 2.9.3 | PGDG 2.9.3 |
el9.aarch64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.19.3 | MISS |
el10.x86_64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | MISS | MISS |
el10.aarch64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | MISS | MISS |
d12.x86_64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.19.3 | MISS |
d12.aarch64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.19.3 | MISS |
d13.x86_64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | MISS | MISS |
d13.aarch64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | MISS | MISS |
u22.x86_64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.19.3 | MISS |
u22.aarch64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.19.3 | MISS |
u24.x86_64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.19.3 | MISS |
u24.aarch64 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.23.0 | PIGSTY 2.19.3 | MISS |
Source
pig build pkg timescaledb; # build rpm / deb with pigInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgdg pigsty -u # add both repo and update cacheInstall this extension with pig:
pig install timescaledb; # install via package name, for the active PG version
pig install timescaledb -v 18; # install for PG 18
pig install timescaledb -v 17; # install for PG 17
pig install timescaledb -v 16; # install for PG 16
pig install timescaledb -v 15; # install for PG 15Config this extension to shared_preload_libraries:
shared_preload_libraries = 'timescaledb';Create this extension with:
CREATE EXTENSION timescaledb;Usage
Create a table and turn it into hypertable
DROP TABLE IF EXISTS ts_test;
CREATE TABLE ts_test
(
id BIGINT PRIMARY KEY,
ts TIMESTAMPTZ NOT NULL,
v INTEGER -- payload
);
SELECT create_hypertable('ts_test', by_range('id'));
INSERT INTO ts_test
SELECT i, now() + (i || ' seconds')::INTERVAL, i % 100
FROM generate_series(1, 1000000) i;
ALTER TABLE ts_test SET (timescaledb.compress_chunk_time_interval = '24 hours');Continuous Agg Example:
CREATE MATERIALIZED VIEW continuous_aggregate_daily( timec, minl, sumt, sumh )
WITH (timescaledb.continuous) AS
SELECT count(*) FROM ts_test;
SELECT add_job('SELECT 1','1h', initial_start => '2024-07-09 18:52:00+00'::timestamptz);Last updated on