skip to Main Content

Timescale/PostgreSQL – pivot timeseries data

I have the following table, containing timeseries data. All datapoints of one "dataset" have the same timestamp and value "const". The following example shows two of these "datasets". +-----------+----------+----------+-------------+ | timestamp | const | name | value | +-----------+----------+----------+-------------+ |…

VIEW QUESTION

Postgresql – How set variable as date type in psql?

to_date can convert string into date: select to_date('2024-01-01','YYYY-MM-DD'); to_date ------------ 2024-01-01 (1 row) Let's check the data type: select pg_typeof(to_date('2024-01-01','YYYY-MM-DD')); pg_typeof ----------- date Why can't set an variable as date type? set mydate to_date('2024-01-01','YYYY-MM-DD') select :mydate; ERROR: column "yyyy" does…

VIEW QUESTION
Back To Top
Search