Dies gibt Ihnen die Frist :
select id,
title,
created_at + interval '1' day * claim_window as deadline
from projects
Alternativ die Funktion make_interval
kann verwendet werden:
select id,
title,
created_at + make_interval(days => claim_window) as deadline
from projects
Um alle Projekte zu erhalten, deren Frist abgelaufen ist, verwenden Sie:
select *
from (
select id,
created_at + interval '1' day * claim_window as deadline
from projects
) t
where localtimestamp at time zone 'UTC' > deadline