By_range does not exist


I have enabled the timescaledb extension on the Azure Postgres Flexible database. When trying to create a hypertable, I am getting the following error. Below is the table creation, hypertable creation, and error.

create table ryan.speed_tracking
    id          bigserial,
    driver_id   text,
    unit_id     text      not null,
    unit_type   text       not null,
    speed       integer          not null,
    speed_limit integer,
    latitude    double precision not null,
    longitude   double precision not null,
    timestamp   timestamp        not null,
    state       text

SELECT create_hypertable('ryan.speed_tracking', by_range('timestamp'));
ERROR: function by_range(unknown) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. Position: 44

The extension for azure is not up to date.

Try to use the column name directly:

SELECT create_hypertable('ryan.speed_tracking', 'time')

The docs refers to latest version and you can use the old reference.

That worked. Thanks!

1 Like