can insert timestamp value that can't be read

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема can insert timestamp value that can't be read
Дата
Msg-id 1399415471.27807.49.camel@sussancws0025
обсуждение исходный текст
Ответы Re: can insert timestamp value that can't be read
Список pgsql-bugs
Example:

  => create table r(t timestamp);
  CREATE TABLE
  => insert into r values(
         timestamp '294277-01-09 00:00:00' + interval '36 hour'
       );
  INSERT 0 1
  => select * from r;
  ERROR:  timestamp out of range

(A similar case with different values exists when compiled with
--disable-integer-datetimes.)

It looks like timestamp[tz]_pl_interval() is not doing proper validation
in all paths.

Patch attached. I looked for other areas that might be affected, but
none jumped out.

The patch does not introduce any tests because I couldn't think of a
good way to test both integer and float timestamps properly.

Regards,
    Jeff Davis


Вложения

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

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: regression failure on master with --disable-integer-datetimes
Следующее
От: Andres Freund
Дата:
Сообщение: Re: BUG #9635: Wal sender process is using 100% CPU