pgsql-bugs(at)postgresql(dot)org writes:
> Summarized:
> timefield > 'now'::datetime --> NO index
> timefield > 'now'::timestamp --> index is used (OK)
"datetime" is an obsolete type name that will go away entirely in 7.3,
so I cannot get very excited about this. But I believe the issue is
that "timestamp" really means "timestamp with time zone" (in 7.2 anyway)
while "datetime" is translated to "timestamp without time zone", and
from there you fall into the usual traps involving cross-datatype
comparisons.
You'd be well advised to fix all your queries to read
::timestamp with time zone
to make them SQL-spec-compliant and unlikely to break in 7.3.
regards, tom lane