timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.81k stars 885 forks source link

docker image does not work as expected #6486

Open listaction opened 10 months ago

listaction commented 10 months ago

What type of bug is this?

Unexpected error

What subsystems and features are affected?

Platform/OS

What happened?

hi guys, looking forward to using this product. when i get the latest docker image and try to create a table / function - see the following errrors.

example=# CREATE TABLE stocks_real_time (
example(#   time TIMESTAMPTZ NOT NULL,
example(#   symbol TEXT NOT NULL,
example(#   price DOUBLE PRECISION NULL,
example(#   day_volume INT NULL
example(# );
CREATE TABLE
example=# SELECT create_hypertable('stocks_real_time', by_range('time'));
ERROR:  function by_range(unknown) does not exist
LINE 1: SELECT create_hypertable('stocks_real_time', by_range('time'...
                                                     ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
example=# \dc
               List of conversions
 Schema | Name | Source | Destination | Default?
--------+------+--------+-------------+----------
(0 rows)

example=# CREATE EXTENSION IF NOT EXISTS timescaledb;
NOTICE:  extension "timescaledb" already exists, skipping
CREATE EXTENSION
example=# \dx
                                                    List of installed extensions
        Name         | Version |   Schema   |                                      Description
---------------------+---------+------------+---------------------------------------------------------------------------------------
 plpgsql             | 1.0     | pg_catalog | PL/pgSQL procedural language
 timescaledb         | 2.10.2  | public     | Enables scalable inserts and complex queries for time-series data
 timescaledb_toolkit | 1.16.0  | public     | Library of analytical hyperfunctions, time-series pipelining, and other SQL utilities

TimescaleDB version affected

timescale/timescaledb-ha:pg14-latest

PostgreSQL version used

14.1

What operating system did you use?

mac osx 12.6.8

What installation method did you use?

Docker

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

example=# CREATE TABLE stocks_real_time (
example(#   time TIMESTAMPTZ NOT NULL,
example(#   symbol TEXT NOT NULL,
example(#   price DOUBLE PRECISION NULL,
example(#   day_volume INT NULL
example(# );
CREATE TABLE
example=# SELECT create_hypertable('stocks_real_time', by_range('time'));
ERROR:  function by_range(unknown) does not exist
LINE 1: SELECT create_hypertable('stocks_real_time', by_range('time'...
                                                     ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
example=# \dc
               List of conversions
 Schema | Name | Source | Destination | Default?
--------+------+--------+-------------+----------
(0 rows)

example=# CREATE EXTENSION IF NOT EXISTS timescaledb;
NOTICE:  extension "timescaledb" already exists, skipping
CREATE EXTENSION
example=# \dx
                                                    List of installed extensions
        Name         | Version |   Schema   |                                      Description
---------------------+---------+------------+---------------------------------------------------------------------------------------
 plpgsql             | 1.0     | pg_catalog | PL/pgSQL procedural language
 timescaledb         | 2.10.2  | public     | Enables scalable inserts and complex queries for time-series data
 timescaledb_toolkit | 1.16.0  | public     | Library of analytical hyperfunctions, time-series pipelining, and other SQL utilities

### How can we reproduce the bug?

```bash
docker run -d --name timescaledb -p 5433:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg14-latest
 psql "postgres://postgres:password@localhost:5433/"

 CREATE TABLE stocks_real_time (                                                                                                                                                                                                         time TIMESTAMPTZ NOT NULL,                                                                                                                                                                                                                       symbol TEXT NOT NULL,                                                                                                                                                                                                                            price DOUBLE PRECISION NULL,                                                                                                                                                                                                                     day_volume INT NULL                                                                                                                                                                                                                            );

SELECT create_hypertable('stocks_real_time', by_range('time'));
jnidzwetzki commented 10 months ago

Hello @listaction,

Thanks for reaching out. The function by_range was added in TimescaleDB 2.13.0. According to the output you provided, you are using TimescaleDB 2.10.2. Please upgrade TimescaledDB to version 2.13.0. Afterward, you can use this function:

test2=# CREATE TABLE stocks_real_time (
test2(#    time TIMESTAMPTZ NOT NULL,
test2(#    symbol TEXT NOT NULL,
test2(#    price DOUBLE PRECISION NULL,
test2(#   day_volume INT NULL
test2(# );
CREATE TABLE
test2=# SELECT create_hypertable('stocks_real_time', by_range('time'));
 create_hypertable 
-------------------
 (63,t)
(1 row)
github-actions[bot] commented 2 weeks ago

Dear Author,

This issue has been automatically marked as stale due to lack of activity. With only the issue description that is currently provided, we do not have enough information to take action. If you have or find the answers we would need, please reach out. Otherwise, this issue will be closed in 30 days.

Thank you!