#10573·timescaledb

"timestamp out of range" with chunk skipping and valid "-infinity" timestamp

Author: akuzmCreated Sep 9, 2026Updated Sep 9, 2026
Labelsbugchunk-skipping
-- Chunk skipping on a timestamptz column: when a chunk holds only
-- '-infinity' in the tracked column, queries filtering on that column
-- fail with "timestamp out of range".

SET timescaledb.enable_chunk_skipping = on;

CREATE TABLE loyalty_members(
    joined       timestamptz NOT NULL,
    member_since timestamptz
);
SELECT create_hypertable('loyalty_members', 'joined');
SELECT enable_chunk_skipping('loyalty_members', 'member_since');
ALTER TABLE loyalty_members SET (timescaledb.compress);

INSERT INTO loyalty_members VALUES ('2025-01-01', '-infinity');
SELECT count(compress_chunk(c)) FROM show_chunks('loyalty_members') c;

-- this returns 1
SET timescaledb.enable_chunk_skipping = off;
SELECT count(*) FROM loyalty_members
    WHERE joined > now() - interval '10 years'
        AND member_since < '2020-01-01';

SET timescaledb.enable_chunk_skipping = on;
SELECT count(*) FROM loyalty_members
    WHERE joined > now() - interval '10 years'
        AND member_since < '2020-01-01'; -- ERROR:  timestamp out of range