Let's say I am doing similar query (where due_date is of type date) :
SELECT
(due_date + (7 * INTERVAL '1 DAY')) AS due_date_mod
FROM test_table
The resulting due_date_mod is type timestamp.
This makes sense as the result of the operation should be one type regardless of specific values and interval can have hours/minutes/seconds.
But is there a way to add days/months/years to a date without the result being time stamp and also obviously without casting? Or is casting the only way?
I know I can add days by using:
SELECT
(due_date + INTEGER '7') AS due_date_mod
And the result is type date.
But can I do something similar for months or years (without converting them to days)?
EDIT: There seems to be no solution satisfying the requirements of the question. Proper way to get the required results is in the marked answer.