Brug funktionen generate_series(start, stop, step interval)
, f.eks.:
select d::date, coalesce(total, 0) as total
from generate_series('2018-01-01', '2018-01-31', '1 day'::interval) d
left join my_table t on d::date = t.date
Fungerende eksempel i rextester.