Troubleshooting
This section contains some ideas for troubleshooting common problems experienced with hyperfunctions.
Queries using locf()
don’t treat NULL
values as missing
When you have a query that uses a last observation carried forward (locf) function, the query carries forward NULL values by default. If you want the function to ignore NULL values instead, you can set treat_null_as_missing=TRUE
as the second parameter in the query. For example:
dev=# select * FROM (select time_bucket_gapfill(4, time,-5,13), locf(avg(v)::int,treat_null_as_missing:=true) FROM (VALUES (0,0),(8,NULL)) v(time, v) WHERE time BETWEEN 0 AND 10 GROUP BY 1) i ORDER BY 1 DESC;
time_bucket_gapfill | locf
---------------------+------
12 | 0
8 | 0
4 | 0
0 | 0
-4 |
-8 |
(6 rows)
Install or upgrade of TimescaleDB Toolkit fails
`
ERROR: extension "timescaledb_toolkit" has no update path from version "1.2" to version "1.3"
`
In some cases, when you create the TimescaleDB Toolkit extension, or upgrade it with the ALTER EXTENSION timescaledb_toolkit UPDATE
command, it might fail with the above error.
This occurs if the list of available extensions does not include the version you are trying to upgrade to, and it can occur if the package was not installed correctly in the first place. To correct the problem, install the upgrade package, restart PostgreSQL, verify the version, and then attempt the update again.
Troubleshooting TimescaleDB Toolkit setup
If you’re installing Toolkit from a package, check your package manager’s local repository list. Make sure the TimescaleDB repository is available and contains Toolkit. For instructions on adding the TimescaleDB repository, see the installation guides:
Update your local repository list with
apt update
oryum update
.Restart your PostgreSQL service.
Check that the right version of Toolkit is among your available extensions:
SELECT * FROM pg_available_extensions
WHERE name = 'timescaledb_toolkit';
The result should look like this:
-[ RECORD 1 ]-----+--------------------------------------------------------------------------------------
name | timescaledb_toolkit
default_version | 1.6.0
installed_version | 1.6.0
comment | Library of analytical hyperfunctions, time-series pipelining, and other SQL utilities
Retry
CREATE EXTENSION
orALTER EXTENSION
.