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.26.4 |
TIME
|
Timescale
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--sLdt-
|
No
|
Yes
|
Yes
|
Yes
|
no
|
yes
|
| Relationships | |
|---|---|
| Schemas | timescaledb_information timescaledb_experimental |
| 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.26.4 |
18
17
16
15
14
|
timescaledb |
- |
| RPM | PIGSTY
|
2.26.4 |
18
17
16
15
14
|
timescaledb-tsl_$v |
- |
| DEB | PIGSTY
|
2.26.4 |
18
17
16
15
14
|
postgresql-$v-timescaledb-tsl |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
el8.aarch64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
el9.x86_64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
el9.aarch64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
el10.x86_64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
MISS
|
el10.aarch64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
MISS
|
d12.x86_64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
d12.aarch64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
d13.x86_64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
MISS
|
d13.aarch64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
MISS
|
u22.x86_64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
u22.aarch64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
u24.x86_64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
u24.aarch64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.19.3
|
u26.x86_64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
MISS
|
u26.aarch64
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
PIGSTY 2.26.4
|
MISS
|
Source
pig build pkg timescaledb; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -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
Source: README, TimescaleDB 2.26.4 release, create_hypertable() API, CREATE TABLE hypertable API, continuous aggregates guide, add_job() API, add_columnstore_policy() API
timescaledb is a PostgreSQL extension for time-series and event analytics. The current docs emphasize hypertables, continuous aggregates, automation jobs, and moving older chunks into the columnstore.
Hypertables
CREATE EXTENSION timescaledb;
CREATE TABLE ts_test (
ts timestamptz NOT NULL,
id bigint,
v integer
);
SELECT create_hypertable('ts_test', by_range('ts'));create_hypertable()still works, but the API docs mark it as old since TimescaleDB 2.20.0 and point new users towardCREATE TABLE ... WITH (...).- The current README also shows the newer pattern:
CREATE TABLE ... WITH (tsdb.hypertable).
Continuous aggregates and jobs
CREATE MATERIALIZED VIEW ts_hourly
WITH (timescaledb.continuous) AS
SELECT time_bucket('1 hour', ts) AS bucket,
count(*) AS cnt,
avg(v) AS avg_v
FROM ts_test
GROUP BY bucket;
SELECT add_continuous_aggregate_policy(
'ts_hourly',
start_offset => INTERVAL '3 hours',
end_offset => INTERVAL '1 hour',
schedule_interval => INTERVAL '1 hour'
);
SELECT add_job('user_defined_action', '1h');- Continuous aggregates require
time_bucket(...)on the hypertable’s time dimension. - In TimescaleDB 2.13 and later, real-time aggregates are disabled by default unless configured otherwise.
Columnstore
ALTER TABLE ts_test SET (
timescaledb.enable_columnstore,
timescaledb.orderby = 'ts DESC'
);
CALL add_columnstore_policy('ts_test', after => INTERVAL '1 day');- The docs treat
add_columnstore_policy()andconvert_to_columnstore()as the current APIs. - Older compression functions such as
add_compression_policy()are documented as old APIs replaced by the columnstore interface.
Caveats
- TimescaleDB 2.26.4 is a bug-fix release over 2.26.3; the release notes recommend upgrading but do not add a new SQL usage surface for hypertables, continuous aggregates, jobs, or columnstore.
- Relevant 2.26.4 fixes touch continuous aggregate planning and refresh, runtime chunk exclusion, background worker restart after restore, sparse indexes on
orderby, and compressed chunk merge safety. Keep using the documented APIs above rather than changing SQL for the patch release itself.
Last updated on