Postgres INTERVAL using value from table

Simply multiply the value with an interval:

select create_ts + num_of_day * interval '1' day 
from abc_company;

Since Postgres 9.4 this is easier done using the make_interval() function:

select create_ts + make_interval(days => num_of_day)
from abc_company;

Leave a Comment