When I try and enable compression on my TimeScale DB hypertable using this query: I get the following error: All I can say is that AssetId is a valid column in the Session table. I’m not sure what else to try. Is anybody familiar with this error and could offer a solution please? Thank you Answer Someti…
Tag: timescaledb
How do I join a string and an int in PostgreSQL?
I have a procedure with an int parameter. The syntax for the add_retention_policy function is add_retention_policy(‘hypertable’, INTERVAL ‘x days’, true). I want to prefix the hypertable with the schema which is always ‘schema_’ and then followed by the id parameter, how do…
TimescaleDB – how get timestamp differences between rows?
Say you need to know how long something was ‘active’ in a time range – (with timestamp in minutes, as an example) – For a 0-15min bucket, the answer would be 6.8-3.5 + 15-9.3 = 9.0mins. (ie the first active state lasts 6.8-3.5mins, the next one goes from 9.3mins to the 15min barrier). …
Ruby on Rails converting Timescale SQL rate code to Ruby
I’m trying to use the Rate function from timescale to generate graph data. Right now I have a database view that does this using the concepts from the SQL code below from TimescaleDocs: Is there a way to convert this directly to ruby code in a timeseries model to improve runtime? Answer It’s possi…
Calculating average with biginteger time intervals using TimescaleDB
I have a schema with the following fields: Name of row | Type ————————–+——– name | string value1 | numeric …
Postgres query nested JSONB
I have a JSONB column containing list of objects.> Here’s the table schema: column Name | Datatype ——————— timestamp | timestamp data | JSONB Sample Data 1. timestamp : …
How to use timebucket_gapfill when rows can have null values?
I have a time series table where measurements are recorded into “wide” rows. Rows may contain all measurements or only some. The other columns are then set to NULL. I would like to use timebucket_gapfill() to “clean” this table and make sure that every row in the output has data in all…