Re: what's wrong with my date comparison?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: what's wrong with my date comparison?
Дата
Msg-id 23446.1192568036@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: what's wrong with my date comparison?  ("Tena Sakai" <tsakai@gallo.ucsf.edu>)
Список pgsql-sql
"Tena Sakai" <tsakai@gallo.ucsf.edu> writes:
> I was missing quotes.
> It must have evaluated 2007-10-02 and used it as a
> numerical constant 1995.

Actually, what you got was a *textual* comparison between '1995' and
the timestamp converted to text, which makes even less sense.

FWIW, as of PG 8.3 you'll get an error:

regression=# select * from timestamp_tbl where d1 > 2007-10-02;
ERROR:  operator does not exist: timestamp without time zone > integer
LINE 1: select * from timestamp_tbl where d1 > 2007-10-02;                                            ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

We've seen too many people get burnt by variants of this problem...
        regards, tom lane


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: what's wrong with my date comparison?
Следующее
От: "Sofer, Yuval"
Дата:
Сообщение: when inserting to table, text type parameter become NULL (after big assignment to this parameter)