Skip to content

TimescaleDB - Community v Apache #12

@anton-schieber

Description

@anton-schieber

Hey,

Curious if you would consider supporting different versions: https://docs.tigerdata.com/about/latest/timescaledb-editions/

For example, if my table is set up to use compression (not supported in apache version) it would error out and fail to complete migration

The current output looks something like this:

SELECT create_hypertable('orders', 'timestamp');
SELECT set_chunk_time_interval(orders', INTERVAL '7 day');
ALTER TABLE orders SET (timescaledb.compress = true);
SET timescaledb.enable_chunk_skipping = 'ON';
SELECT enable_chunk_skipping('orders', 'device_id');

Instead could it have something like which will allow it to always pass the migration regardless of which version/ext of timescaledb used

DO $$
DECLARE
    license TEXT;
BEGIN
    SELECT current_setting('timescaledb.license', true) INTO license;

    -- Create hypertable (works for all licenses)
    PERFORM create_hypertable('orders', 'timestamp', if_not_exists => TRUE);

    -- Only run enterprise features if license is not 'apache'
    IF license IS DISTINCT FROM 'apache' THEN
        PERFORM set_chunk_time_interval('orders', INTERVAL '7 day');
        EXECUTE 'ALTER TABLE orders SET (timescaledb.compress = true)';
        PERFORM enable_chunk_skipping('orders', 'device_id');
    ELSE
        RAISE NOTICE 'Skipping enterprise-only features (compression, chunk skipping)';
    END IF;
END $$;

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions