Re: Unable to convert null timestamp to date. Bug?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unable to convert null timestamp to date. Bug?
Дата
Msg-id 28880.976237311@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Unable to convert null timestamp to date. Bug?  ("Edmar Wiggers" <edmar@brasmap.com>)
Список pgsql-sql
"Edmar Wiggers" <edmar@brasmap.com> writes:
>   select * from users where last_visit + 7 > now();
>   ERROR:  Unable to convert null timestamp to date

Yeah, someone who hadn't quite grokked the concept of NULL seems to have
written a lot of the date.c code :-(.

This is fixed for 7.1.  If it's really bothering you in 7.0.*, see
src/backend/utils/adt/date.c, and change code like
   if (!PointerIsValid(timestamp))       elog(ERROR, "Unable to convert null timestamp to date");

to
   if (!PointerIsValid(timestamp))return NULL;

in several places.
        regards, tom lane


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

Предыдущее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: trying to pattern match to a value contained in a column
Следующее
От: Joseph Shraibman
Дата:
Сообщение: FOREIGN KEY errors.