Skip to content
Back to skills

Timescaledb Knowledge Patch

ASecurity

TimescaleDB

  • 25 stars
  • 0 votes
  • 0 copies
  • 21 views
  • Added September 5, 2026
developmentgosqlnodeexpressdebuggingapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill timescaledb-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Timescaledb Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Timescaledb Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-timescaledb-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-timescaledb-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: timescaledb-knowledge-patch
description: TimescaleDB
version: "2.32.1"
license: MIT
metadata:
  author: Nevaberry
---


# TimescaleDB Knowledge Patch

Load this skill when upgrading TimescaleDB, configuring hypertables or columnstore
storage, maintaining continuous aggregates, or diagnosing queries and background jobs.
Use the topic references for the detailed conditions, examples, and version attribution.

## Reference index

| Reference | Topics |
| --- | --- |
| [Upgrades and compatibility](references/upgrades-and-compatibility.md) | PostgreSQL compatibility, upgrade order, packages, Hypercore migration, bloom migrations, removed APIs, catalogs |
| [Columnstore and compression](references/columnstore-and-compression.md) | API replacements, layout defaults, compression algorithms, sparse indexes, Direct Compress, recompression, compaction |
| [Continuous aggregates](references/continuous-aggregates.md) | Refresh batching, concurrency, invalidation, granular refresh, query functions, rewrites, added columns, maintenance, statistics |
| [Hypertables, chunks, and DDL](references/hypertables-chunks-and-ddl.md) | Declarative creation, table options, UUIDv7, chunk operations, constraints, triggers, publications, ownership |
| [Operations, jobs, and query behavior](references/operations-jobs-and-query-behavior.md) | Job configuration and permissions, scheduling, telemetry, scans, GapFill, time buckets, DML correctness |

## Upgrade blockers and compatibility changes

### PostgreSQL minor upgrades

Upgrade to TimescaleDB 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 PostgreSQL
through 18.6, 17.11, and 16.15, respectively; scheduled jobs fail on newer minors.
TimescaleDB 2.32.1 also supports older PostgreSQL minor releases.

### Hypercore table access method

The `hypercore` table access method was 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 each affected relation to `heap` before upgrading:

```sql
ALTER TABLE metrics SET ACCESS METHOD heap;
```

### Bloom indexes and extension updates

- Upgrading to 2.24 disables bloom sparse indexes on chunks compressed before the
  upgrade. Decompress and compress those chunks to rebuild the indexes in the new
  format. The reference describes the official AMD64 APT legacy-hashing exception.
- To retain composite bloom indexes built in 2.26, run the supplied migration script
  when upgrading to 2.27; see the migration link in the upgrade reference.
- The 2.27.0 upgrade blocks affected bloom sparse indexes on compressed `int2`
  columns; manually drop them first. Starting with 2.28.2, extension upgrades
  automatically drop incompatible bloom indexes on compressed `smallint` columns.
- Use 2.29.0 or later for `rebuild_sparse_index()` on compressed chunks;
  earlier versions could leave stale index entries.

Connect with `psql -X` to skip `.psqlrc` commands that could load the old extension:

```sh
psql -X -d metrics -c 'ALTER EXTENSION timescaledb UPDATE;'
```

### Removed and renamed interfaces

- The 2.24.0 guidance announces removal of the deprecated partial continuous-aggregate
  format in the next release. Run `cagg_migrate` on each affected aggregate before upgrading.
- The WAL-based invalidation preview was removed in 2.25.0. Use trigger-based
  invalidation and remove configuration that enabled the preview.
- `time_bucket_ng` was removed in 2.25.0. Adaptive chunking was removed in 2.28.0;
  use a fixed chunk interval for hypertables that relied on it.
- From 2.30.2, update granular refresh overrides to `timescaledb.cagg_granular_refresh_*`.
- For 2.31.0 columnar scan debugging, replace `timescaledb.enable_columnarscan`
  overrides with `timescaledb.debug_enable_columnarscan`.
- In 2.31.0, `timescaledb.enable_direct_compress_copy_sort_batches` and
  `timescaledb.enable_direct_compress_insert_sort_batches` are available only in debug
  builds. Remove their overrides when upgrading a non-debug build.
- In 2.32.0, `bloom1_contains()` is removed and `bloom1_contains_any()` rejects
  anonymous record arrays.

## Compression API deprecations

The compression APIs deprecated in 2.18.0 are slated for removal in the next major
release. Use these replacements:

| Deprecated interface | Replacement |
| --- | --- |
| `decompress_chunk` | `CALL convert_to_rowstore(...)` |
| `compress_chunk` | `CALL convert_to_columnstore(...)` |
| `add_compression_policy` / `remove_compression_policy` | `add_columnstore_policy` / `remove_columnstore_policy` |
| `hypertable_compression_stats` / `chunk_compression_stats` | `hypertable_columnstore_stats` / `chunk_columnstore_stats` |
| `timescaledb.compress` | `timescaledb.enable_columnstore` |
| `timescaledb.compress_segmentby` / `timescaledb.compress_orderby` | `timescaledb.segmentby` / `timescaledb.orderby` |

The columnstore reference also gives the deprecated view mappings and the
`timescaledb_information.hypertable_columnstore_settings` inspection view.

## Create and configure hypertables

Declarative creation can enable the columnstore. From 2.23.0, `partition_column`
is optional; enabling the columnstore also creates a columnstore policy and sets
the job's `next_start`.

```sql
CREATE TABLE readings (time timestamptz NOT NULL, value double precision)
WITH (tsdb.hypertable, tsdb.columnstore = true);
```

`tsdb` aliases `timescaledb` in reloption `WITH` and `SET` clauses.
Use `ALTER TABLE ONLY ... SET` to apply option changes only to future chunks.
Hypertable creation is blocked for tables implicitly included in a logical replication
publication. The Apache 2 Edition accepts declarative creation with `columnstore` omitted.

A UUIDv7 column can be the time partitioning column; chunk boundaries use its encoded
timestamp. `uuid_timestamp()` extracts that timestamp. `time_bucket` accepts UUIDv7
values and returns `timestamptz`; use the UUIDv7 partition column as the bucket input
for a continuous aggregate on a UUIDv7-partitioned hypertable.

## Columnstore writes and maintenance

Explicit `orderby` suppresses automatic `segmentby` selection. Date and time columns
are excluded from automatic `segmentby` selection. A `NULL` `orderby` blocks downgrading.

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 that count uncapped. `compact_chunk()` supports manual
compaction with a `max_batches` limit. A columnstore policy's `recompress_unordered`
option recompresses unordered chunks.

Enable Direct Compress for one hypertable independently of global settings:

```sql
ALTER TABLE metrics SET (tsdb.direct_compress = true);
```

The `COPY` Direct Compress feature was introduced as experimental and off by default.
Enable `timescaledb.enable_direct_compress_copy_client_sorted` only for correctly
sorted client input. Direct Compress bypasses inserts into tables with exclusion
constraints so those constraints are enforced. The columnstore reference gives the
sorting controls, constraint checks, and fixes for potential data loss.

## Refresh and extend continuous aggregates

Refresh policies use incremental refresh by default from 2.21.0 and default to
`buckets_per_batch => 10` from 2.25.0. Use `refresh_newest_first => false` to process
older batches first. Manual refresh batching is supported from 2.28.0:

```sql
CALL refresh_continuous_aggregate(
    'metrics_hourly',
    TIMESTAMPTZ '2026-06-01 00:00+00',
    TIMESTAMPTZ '2026-06-08 00:00+00',
    buckets_per_batch => 24,
    max_batches_per_execution => 3,
    refresh_newest_first => false
);
```

Refreshes can run concurrently over non-overlapping time ranges; policies can cover
separate windows. Concurrent policies also work on hierarchical continuous aggregates.
Set `include_tiered_data => true` in `add_continuous_aggregate_policy` to read tiered data.

For bulk loads, enable `timescaledb.skip_cagg_invalidation` for the load transaction
to suppress DML and DDL invalidations, then force a refresh of the affected window.
The setting defaults to `off`. A refresh with `force => true` consumes pending
invalidations for the refreshed window.

Add a stored generated column to materialize another aggregate over source data.
Existing rows initially contain `NULL` in the added column; a forced refresh backfills
the requested window. `ANALYZE` and `VACUUM` accept the continuous aggregate directly.

Non-immutable and window functions in continuous aggregates are experimental.
Window functions require `timescaledb.enable_cagg_window_functions`, default `off`.
Direct compression during refresh is also experimental and off by default, controlled
by `timescaledb.enable_direct_compress_on_cagg_refresh`.

Disable granular refresh before altering or dropping its tracking column.
Materialization hypertables reject granular refresh. Use
`timescaledb.cagg_refresh_stats_level = 'summary'` or `verbose_log` to collect refresh
statistics, including rows materialized and deleted; its default is `off`.

## Jobs, permissions, and query diagnostics

Pass a JSONB object as `config_merge` to `alter_job()` to update selected settings
while retaining other existing keys:

```sql
SELECT alter_job(1000, config_merge => '{"drop_after": "90 days"}'::jsonb);
```

From 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 chunk ownership.

In 2.32.1, a job invoked with `CALL run_job(...)` can commit when PostgreSQL permits
transaction control, such as in a top-level call.

`ColumnarScan` is the plan-node name replacing `DecompressChunk`. `ColumnarIndexScan`
is enabled by default from 2.26.0 for eligible queries using `COUNT`, `MIN`, `MAX`, or
supported forms of `FIRST` and `LAST`. Grouping expressions, `GROUPING SETS`, `ROLLUP`,
and `CUBE` are excluded from `ColumnarIndexScan` from 2.27.1.

The `timezone` argument to `time_bucket_gapfill` must be constant from 2.26.0.
With `date` input, `time_bucket` rejects sub-day offsets; negative whole-day offsets
are accepted from 2.31.0. See the operations reference for query correctness fixes.

Files in this skill

  • SKILL.md8.7 KB
  • coverage.json1.4 KB
  • references/columnstore-and-compression.md8.5 KB
  • references/continuous-aggregates.md6 KB
  • references/hypertables-chunks-and-ddl.md4.7 KB
  • references/operations-jobs-and-query-behavior.md4.1 KB
  • references/upgrades-and-compatibility.md5.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.