I am using pq library in golang for postgres queries. I want to pass timestamp in the query string.
Ex. query = 'SELECT \* FROM table WHERE ts \<= NOW() - interval '5 seconds''
Instead of NOW()
...can I pass a timestamp?
Ex.
t=time.Now()
query = 'SELECT \* FROM table WHERE ts \<= t- interval '5 seconds''
I tried formatting the timestamp and using arguments to pass the timestamp but getting errors.