Re: [HACKERS] Re: [GENERAL] leap day bug after 1901

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: [HACKERS] Re: [GENERAL] leap day bug after 1901
Дата
Msg-id 37136E7F.F2929BFC@alumni.caltech.edu
обсуждение исходный текст
Ответ на leap day bug after 1901  (José Soares <jose@sferacarta.com>)
Список pgsql-general
> > > prova=> select date '1901-02-29';
> > > ERROR:  date_in: day must be limited to values 1 through 28
> > > prova=> select date '1902-02-29';
> > > ----------
> > > 1902-03-01
> > Any body knows why PostgreSQL checks for date validity only
> > for dates less than 1902 and greater than 2037 ?

postgres=> select date '1902-02-29 UTC';
ERROR:  date_in: day must be limited to values 1 through 28

For dates somewhere close the the Unix system time range, I use system
routines to determine the local time zone if it was not specified in
the input. That call also shifts/resolves the input time fields to be
consistant. Afterwards, I check for a valid day, but the shift has
already hidden the problem.

I'll look at moving the checks to within the parsing code, to just
before the time zone is resolved.

This will also affect the behavior of datetime and abstime.

                    - Tom

--
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California

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

Предыдущее
От: De Leersnijder Frederic
Дата:
Сообщение: Converting MS Access to postgres under linux.
Следующее
От: Oleg Broytmann
Дата:
Сообщение: Re: [GENERAL] Opening two databases at the same time?