I have this in the where clause of my SQL query:
‘2023/10/21 14:46:32.805068000’ + interval ‘1 second’
This causes me to have an "invalid input syntax for type interval" error.
Does anyone have a suggestion?
I have this in the where clause of my SQL query:
‘2023/10/21 14:46:32.805068000’ + interval ‘1 second’
This causes me to have an "invalid input syntax for type interval" error.
Does anyone have a suggestion?
2
Answers
You have to tell PostgreSQL that the first string is a timestamp
If you don’t PostgreSQL tries to guess, and assumes you are adding 2 values with the same type (2 intervals).
You need to have a timestamp datatype to calculate .
fiddle