> I have quite interesting problem. I have a table with a timestamp field.
> I have an index on it. When I use constant date in where clause, PostgreSQL
> uses index. But when I try to use now() there, it uses a sequence scan.
> As far as I can understand in inside any query now() is a constant.
> What is the problem here.
You did not specify what version of PostgreSQL you are running, but it
may be that now() is returning abstime, not timestamp.
Use the constant "timestamp 'now'" instead; seems to work for me in
PgSQL 7.1.
- Thomas