Re: Timestamp precision and rounding
От | Stephan Szabo |
---|---|
Тема | Re: Timestamp precision and rounding |
Дата | |
Msg-id | 20040604184539.X37426@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | Timestamp precision and rounding (Jeff Boes <jboes@nexcerpt.com>) |
Ответы |
Re: Timestamp precision and rounding
Re: Timestamp precision and rounding |
Список | pgsql-general |
On Thu, 3 Jun 2004, Jeff Boes wrote: > (asked last week on .questions, no response) > > Can anyone explain why this happens? (under 7.4.1) > > select '2004-05-27 09:00:00.500001-04' :: timestamp(0) ; > > timestamp > --------------------- > 2004-05-27 09:00:01 > > > select '2004-05-27 09:00:00.500000-04' :: timestamp(0) ; > > timestamp > --------------------- > 2004-05-27 09:00:00 > > > That is, why doesn't the second operation result in the same timestamp > as the first? Is it a floating-point representation issue, or are the > mathematical rules of rounding not being followed correctly (as I > understand them, anyway)? My first guess would be that your system probably implements its default rounding as nearest even for .5 results, what does 9:00:01.5 give you?
В списке pgsql-general по дате отправления: