It seems to me that Postgres will treat it as
a constant.


Yeah, that works too, though again it might burn you if used inside a
function or prepared statement.  What you're doing here is to push the
freezing of the "now" value even further upstream, namely to initial
parsing of the command.

What I do in my apps to get postgres to use the timestamp indexes in some situations is to just generate the current timestamp in iso format and then just insert it into the query as a constant, for that run of the query.


Chris


---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to