Re: Bug #747: PostgreSQL doesn't use indexes right sometimes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug #747: PostgreSQL doesn't use indexes right sometimes
Дата
Msg-id 1874.1030388740@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bug #747: PostgreSQL doesn't use indexes right sometimes  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
pgsql-bugs@postgresql.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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #747: PostgreSQL doesn't use indexes right sometimes
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Bug #693: python interface doesn't handle int8 correctly.