Strange behavior with leap dates and centuries BC

Поиск
Список
Период
Сортировка
От Bernd Helmle
Тема Strange behavior with leap dates and centuries BC
Дата
Msg-id 2F0F5BDC74EB050246A4DB48@imhotep.credativ.de
обсуждение исходный текст
Ответы Re: Strange behavior with leap dates and centuries BC  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I saw this strange behavior due to a customer problem who managed to get 
dumps which aren't restorable anymore:

CREATE TABLE foo(datum date);

INSERT INTO foo VALUES('0000-02-29');
INSERT 0 1

SELECT * FROM foo;    datum
---------------0001-02-29 BC
(1 row)

COPY foo TO STDOUT;
0001-02-29 BC

INSERT INTO foo VALUES('0001-02-29 BC');
ERROR:  date/time field value out of range: "0001-02-29 BC"


Huh? It seems the calculation for leap dates with negative year values is 
broken. This example was taken from a current HEAD checkout today, the 
original version i've seen this behavior first was 8.2.4.



--  Thanks
                   Bernd


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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Questions about indexes with text_pattern_ops
Следующее
От: David BOURIAUD
Дата:
Сообщение: Re: One more option for pg_dump...