I am trying to add a calculated column that computes a rolling average of a sorted partition. I can make it work as a query but cannot seem to get the result to become a calculated field.
ALTER TABLE PUBLIC "minutes"
ADD COLUMN "green_avg" NUMERIC (10,2)
AS GENERATED AVG("price") OVER(PARTITION BY "key"
ORDER BY "endtime" ROWS BETWEEN 30 PRECEDING AND CURRENT ROW)