Isso lhe dará o prazo:
select id,
title,
created_at + interval '1' day * claim_window as deadline
from projects
Alternativamente, a função
make_interval
pode ser usado:select id,
title,
created_at + make_interval(days => claim_window) as deadline
from projects
Para obter todos os projetos em que o prazo acabou, use:
select *
from (
select id,
created_at + interval '1' day * claim_window as deadline
from projects
) t
where localtimestamp at time zone 'UTC' > deadline