Skip to content

Support hypertable chunking in terms of calendar months #1500

@hedgss

Description

@hedgss

I need to use calendar month as chunk interval.

SELECT create_hypertable('session_timescaledb', 'session_time_created', 'id', chunk_time_interval => interval '1 month', if_not_exists => TRUE);

I see that it uses 14th as a default partitioning point. It doesn't depend on current date
e.g. I inserted data with "2019-05-01 02:11:14.263069" to the hypertable.
A new chank was created automatically- _timescaledb_internal._hyper_1_1_chunk with following contraint:

"constraint_1" CHECK (session_time_created >= '2019-04-14 00:00:00'::timestamp without time zone AND session_time_created < '2019-05-14 00:00:00'::timestamp without time zone)

Is it possible to create chunks that will store data for calendar month?
e.g. from 2019-04-01 00:00:00 to 2019-05-01 00:00:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions