Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Timescaledb Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-timescaledb-knowledge-patch-nevaberry-plugins)
---
name: timescaledb-knowledge-patch
description: TimescaleDB
version: "2.32.1"
license: MIT
metadata:
author: Nevaberry
---
# TimescaleDB compatibility and operations
Load this skill for TimescaleDB upgrades, hypertable and chunk DDL, columnstore
ingest, continuous aggregates, background jobs, or query-correctness changes.
Use the topic references for complete details, examples, and version-specific
behavior. Earlier defaults and experimental features retain their attributions.
| Reference | Topics |
| --- | --- |
| [Upgrades and compatibility](references/upgrades-and-compatibility.md) | PostgreSQL compatibility, upgrade order, deprecated APIs, removed objects, bloom migrations, catalogs, packages, loader hooks |
| [Columnstore and ingest](references/columnstore-and-ingest.md) | Compression defaults, recompression, Direct Compress, sparse indexes, scans, write correctness, size statistics |
| [Hypertables and chunks](references/hypertables-and-chunks.md) | Declarative creation, table options, UUIDv7, constraints, triggers, chunk operations, replication, ownership |
| [Continuous aggregates](references/continuous-aggregates.md) | Migration, batching, invalidation, aggregate columns, policies, time buckets, GapFill, granular refresh, statistics |
| [Jobs and observability](references/jobs-and-observability.md) | Job configuration, history, status, cancellation, permissions, background workers, telemetry |
## Upgrade blockers and compatibility
Upgrade TimescaleDB to 2.32.1 before installing PostgreSQL 18.7, 17.12, 16.16,
or a later minor in those major versions. TimescaleDB 2.32.0 supports only
through PostgreSQL 18.6, 17.11, and 16.15, respectively; scheduled jobs fail on
newer minors. TimescaleDB 2.32.1 also supports older PostgreSQL minor releases.
The 2.28 series, including its patch releases, is the last to support PostgreSQL
15. Upgrading to 2.29.0 requires PostgreSQL 16, 17, or 18.
The `hypercore` table access method is deprecated in 2.21.0 and removed in
2.22.0. Upgrades to 2.22.0 or later are blocked while any relation uses it.
Convert every affected relation before upgrading:
```sql
ALTER TABLE metrics SET ACCESS METHOD heap;
```
Connect with `psql -X` for an extension update. This skips `.psqlrc` commands
that could load the old extension version before the update runs:
```sh
psql -X -d metrics -c 'ALTER EXTENSION timescaledb UPDATE;'
```
Put `pgaudit` after `timescaledb` in `shared_preload_libraries`; restart PostgreSQL
after upgrading if you need the new hook ordering.
## Deprecations, removals, and migrations
Compression APIs are deprecated and slated for removal in the next major
release. Replace `decompress_chunk` and `compress_chunk` with
`CALL convert_to_rowstore(...)` and `CALL convert_to_columnstore(...)`.
Use the columnstore policy, statistics, and settings names listed in the upgrade
reference, including `timescaledb.enable_columnstore`, `timescaledb.segmentby`,
and `timescaledb.orderby` for table parameters.
The 2.24.0 guidance says the next release will remove the deprecated partial
continuous-aggregate format. Run `cagg_migrate` on each affected aggregate
before upgrading. The experimental policy APIs are slated for removal in an
upcoming release; use the Jobs API to manage those policies.
The preview WAL-based continuous-aggregate invalidation method was removed in
2.25.0. Use trigger-based invalidation and remove configuration that enabled
the WAL preview. `time_bucket_ng` was also removed in 2.25.0.
Use a fixed chunk interval for hypertables that relied on adaptive chunking.
Update catalog queries for the removed `dropped` column of
`_timescaledb_catalog.chunk`, temporary
`_timescaledb_catalog.chunk_constraint` compatibility view, and compression
catalog changes described in the upgrade reference.
In 2.32.0, `bloom1_contains()` is removed and `bloom1_contains_any()` rejects
anonymous record arrays.
For 2.31.0 columnar-scan debugging, replace overrides for
`timescaledb.enable_columnarscan` with `timescaledb.debug_enable_columnarscan`.
Direct Compress batch sorting switches are available only in debug builds;
remove their overrides when upgrading a non-debug build.
## Sparse-index upgrade preparation
Upgrading to 2.24.0 disables bloom sparse indexes on previously compressed
chunks and warns if affected indexes exist. Decompress and compress those
chunks to rebuild the indexes. Legacy indexes from the official AMD64 APT
package can be read in SELECT queries with `timescaledb.read_legacy_bloom1_v1`.
Before upgrading to 2.27.0, manually drop affected bloom sparse indexes on
compressed `int2` columns: the upgrade blocks them because SELECT can omit
matching rows. Starting in 2.28.2, extension upgrades automatically drop these
incompatible indexes. The upgrade reference links the separate migration
script for composite bloom indexes built in 2.26.0.
Use 2.29.0 or later for `rebuild_sparse_index()` on compressed chunks;
earlier versions could leave stale index entries.
## Hypertable creation and schema changes
Create a hypertable and configure its columnstore declaratively:
```sql
CREATE TABLE metrics (time timestamptz NOT NULL, value double precision)
WITH (tsdb.hypertable, tsdb.columnstore = true);
```
`tsdb` aliases `timescaledb` for reloptions. From 2.23.0, `partition_column`
is optional; enabling the columnstore in the declaration also creates a
columnstore policy and sets its job's `next_start`. Hypertable creation is
blocked for tables implicitly included in a logical replication publication.
Use `ALTER TABLE ONLY ... SET` to apply option changes only to future chunks.
Define transition-table triggers on the hypertable: creating one directly on
a chunk raises an error. A hypertable column's type can be changed with the
columnstore enabled if the hypertable has no compressed chunks.
`split_chunk` supports compressed chunks. Merges reject frozen chunks and
hypertables with more than one partitioning dimension. `compact_chunk()`
supports a `max_batches` limit; chunk compaction supports concurrent DML
starting in 2.30.0.
## Columnstore ingest and maintenance
Columnstore chunk recompression allows concurrent INSERT, UPDATE, and DELETE
by default. Set `timescaledb.enable_exclusive_locking_recompression = on`
to restore exclusive locking. Pass `recompress => true` to
`convert_to_columnstore` for in-memory recompression, controlled by
`timescaledb.enable_in_memory_recompression`.
`move_to_columnstore()` compresses chunk rows while allowing concurrent DML.
`timescaledb.move_to_columnstore_tuple_sort_limit` caps tuples sorted at once;
the default `0` leaves the tuple count uncapped.
Direct Compress for COPY was introduced as experimental and off by default.
Enable `timescaledb.enable_direct_compress_copy_client_sorted` only for
correctly sorted client input. The columnstore reference gives COPY and INSERT
switches, tuple sort limits, constraint behavior, and data-loss fixes.
Enable Direct Compress for one hypertable independently of global settings:
```sql
ALTER TABLE metrics SET (tsdb.direct_compress = true);
```
Starting in 2.30.0, this option skips the Direct Compress batch-size check.
In 2.32.0, `COPY FROM ... WITH (ON_ERROR ignore)` skips conversion-error rows;
on PostgreSQL 18 and later it also enforces `REJECT_LIMIT`.
The experimental Adaptive Integer Compressor defaults to off in 2.31.0;
`timescaledb.enable_aic_compression` defaults to on in 2.32.0. The reference
also preserves boolean and UUID compression defaults and compatibility caveats.
## Continuous aggregate refresh and schema maintenance
Refresh policies use incremental refresh by default from 2.21.0 and default to
`buckets_per_batch => 10` from 2.25.0. Set `refresh_newest_first => false` to
process older batches first. Manual refreshes also accept batching controls.
Refreshes can run concurrently over non-overlapping ranges; separate policy
windows and hierarchical continuous aggregates support concurrent policies.
Add a stored generated column to materialize another aggregate over source
data. Existing rows start with NULL in the new column; a forced refresh
backfills the requested time window. `ANALYZE` and `VACUUM` accept a continuous
aggregate directly and operate on its materialization hypertable.
For bulk loads, enable `timescaledb.skip_cagg_invalidation` in the load
transaction to suppress DML and DDL invalidations, then force a refresh of the
affected window to update existing materializations. This setting defaults
to off. Direct Compress on continuous-aggregate sources records invalidations
for ingested data at transaction commit.
Direct Compress during refresh is experimental and off by default; enable
`timescaledb.enable_direct_compress_on_cagg_refresh` to use it. Continuous
aggregates experimentally accept non-immutable and window functions;
window functions require `timescaledb.enable_cagg_window_functions`, also off
by default.
Update granular refresh overrides to `timescaledb.cagg_granular_refresh_*`
in 2.30.2. Disable granular refresh before altering or dropping its tracking
column. Continuous-aggregate materialization hypertables reject granular refresh.
The timezone argument of `time_bucket_gapfill` must be constant. The date
overload of `time_bucket()` rejects sub-day offsets and accepts negative
whole-day offsets. The reference contains UUIDv7 bucketing and GapFill examples.
## Jobs, permissions, and diagnostics
Pass a JSONB `config_merge` object to `alter_job()` to update selected settings
while preserving the other configuration keys:
```sql
SELECT alter_job(1000, config_merge => '{"drop_after": "90 days"}'::jsonb);
```
Starting in 2.32.0, the scheduler and telemetry job run as the database owner.
The database owner can start, stop, and restart background workers without
superuser privileges; a PostgreSQL restart applies the loader changes.
Changing a job's configuration check function requires job ownership.
Chunk operations require ownership of the chunk itself.
In 2.32.1, a job invoked with `CALL run_job(...)` can commit when PostgreSQL
permits transaction control, such as a top-level call.
Set `timescaledb.cagg_refresh_stats_level` to `summary` or `verbose_log` for
refresh statistics, including rows materialized and deleted; its default is
`off`. Refresh messages use `DEBUG1`, so set `log_min_messages` to `DEBUG1`
or a more verbose level to include them in server logs.
Monitor hypertable index builds through `pg_stat_progress_create_index`.
In EXPLAIN, `ColumnarScan` is the renamed `DecompressChunk` node;
`ColumnarIndexScan` is enabled by default for eligible columnstore queries.
The references retain scan eligibility restrictions and query-correctness fixes.