select
sum(value::real) as sum
FROM
analiz_data
--and CURRENT_DATE =f_timestamp::date
--and to_char(current_timestamp, 'YYYY-MM') = to_char(f_timestamp, 'YYYY-MM')
SELECT
d.*,
sum(d.day_sum) OVER (PARTITION BY date_trunc('month', d.f_timestamp)) as month_sum
FROM (
SELECT
f_timestamp::date,
sum(value::real) as day_sum
FROM analiz_data
GROUP BY f_timestamp::date
) d