Re: Postgres (psql ?) rounds all odd second values to e ven seconds fo r timestamp(0) data type
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Postgres (psql ?) rounds all odd second values to e ven seconds fo r timestamp(0) data type |
| Дата | |
| Msg-id | 23983.1043268343@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Postgres (psql ?) rounds all odd second values to e (Csaba Nagy <nagy@domeus.de>) |
| Список | pgsql-general |
Csaba Nagy <nagy@domeus.de> writes:
> I've looked at the code you mentioned, did some experimenting.
> I still don't understand why the negative case ? What dates would be in that
> range ?
IIRC, our internal representation of timestamps puts time 0 at midnight GMT
1/1/2000. Times before that will be negative.
> In any case, the negative number handling seems not doing the same thing as
> the positive one.
That's what I fixed in the patch I applied on 8 Jan.
> The "rint" implementation on my test box has some inconsistentcies too:
Actually, that behavior of "rounding to nearest even" at an xxx.5
boundary is what is specified by the IEEE float-arithmetic standard.
The numerical-analysis justification for the spec doesn't seem to have
much applicability to datetime calculations, perhaps, but that's what
we're going to get on a lot of platforms.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера