BUG #1180: incorrect date handling

Поиск
Список
Период
Сортировка
От PostgreSQL Bugs List
Тема BUG #1180: incorrect date handling
Дата
Msg-id 20040623023249.EB659CF499C@www.postgresql.com
обсуждение исходный текст
Ответы Re: BUG #1180: incorrect date handling
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      1180
Logged by:          Ben Bidner

Email address:      vort@wiretapped.net

PostgreSQL version: 7.3.2

Operating system:   linux 2.4.20

Description:        incorrect date handling

Details:

colony=# CREATE TABLE foo (dtime TIMESTAMP);
CREATE TABLE
colony=# insert into foo values ('2003-12-11 23:59:60.00');
ERROR:  Bad timestamp external representation '2003-12-11 23:59:60.00'
colony=# insert into foo values ('2003-12-11 23:59:59.999999');
INSERT 97940618 1
colony=# select * from foo;
 dtime
----------------------------
 2003-12-11 23:59:59.999999
(1 row)

^-- correct

colony=# insert into foo values ('2003-12-11 23:59:59.9999999');
INSERT 97940623 1
colony=# select * from foo;
 dtime
----------------------------
 2003-12-11 23:59:59.999999
 2003-12-11 23:59:60.00
(1 row)

^-- incorrect

2003-12-11 23:59:60.00 should equal 2003-12-12 00:00:00

under 7.4.2, (had a friend test it out) inserting a timestamp with a time of
23:59:60.00 is allowed, it just increments the day and sets the time to
00:00:00 (as one would expect). However it still allows you to insert the
time as `23:59:59.9999999` and it updates the time (incorrectly) to
`23:59:60.00` instead of incrementing the day and setting the time to
00:00:00 (since 23:59:60 is .. or should be invalid).

vort@wiretapped.net

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: BUG #1177: JDBC driver doesn't handle all dates correctly
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1180: incorrect date handling