This question already has an answer here:
- Postgres INTERVAL using value from table 3 answers
Is there an equivalent to this T-SQL command in PostgreSQL?
select dateadd(hh,duration_in_hours,start_date) as end_date
I have found only interval keyword with subsequent string, but this terrible construction returns syntax error:
select start_date + interval cast(duration_in_hours as varchar) || ' hours'
It allows only string constant after "interval " keyword. I am sure there must be some similar function in pgsql, but I cannot find it.
You can do it like this:
See this sample SQL Fiddle