Вы можете сгенерировать даты рекурсивно, поэтому проблема будет решена путем RECURSIVE CTE
следующим образом:
создать тестовую таблицу:
create table your_table
(
id int not null,
activated_date timestamp not null
);
добавить пример данных:
insert into your_table
values
(2, '2017/01/01'),
(63, '2018/04/23');
и завершить рекурсивный запрос:
with
recursive
cte(id, active_date)
as
(
select
id,
activated_date as active_date
from
your_table
union all
select
t.id,
active_date + justify_days(interval '1 days')
from
cte
inner join
your_table t
on
cte.id = t.id
where
cte.active_date < now()
)
select
*
from
cte
order by 1, 2;
примерить: dbfiddle