I'm trying to INSERT
a future date into a timestamp with time zone
column in a table in Postgres 9.6.2. I'd like this date to be the current transaction time plus an arbitrary interval, such as 1 hour.
I understand how to do date/time arithmetic in a SELECT
statement, but the same syntax of NOW() + INTERVAL '1 hour'
does not seem to be valid in an INSERT
statement.
Aside from accomplishing this at the application level, is it possible to accomplish this using a single INSERT
statement using date/time arithmetic? If not, what would best practice be in this situation?
I think you have it right - this worked for me:
I am running Postgres 9.4.13.