Chris Gamache <cgg007(at)yahoo(dot)com> writes:
> By giving it a definitive range I was able to coax query planner to use the
> index:
> SELECT id FROM trans_table WHERE trans_date >= (SELECT
> current_date::timestamptz) AND trans_date < (SELECT current_timestamp);
> BTW, This didn't work:
> SELECT id FROM trans_table WHERE trans_date >= current_date::timestamptz AND
> trans_date < current_timestamp;
[ scratches head... ] AFAICS the latter should "work" too. Doesn't
EXPLAIN show the same estimated row count for both versions?
regards, tom lane