Re: [BUGS] Convert TimeStamp to Date

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] Convert TimeStamp to Date
Дата
Msg-id 13744.1059006675@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Convert TimeStamp to Date  (Dmitry Tkach <dmitry@openratings.com>)
Список pgsql-general
Dmitry Tkach <dmitry@openratings.com> writes:
> In 7.3 (and 7.4) timestamptz_date () is still doing that (and select
> '1999-12-31 00:00:01'::timestamptz::date still works),
> *but* timestamp_date() is changed for some reason to just divide the
> timestamp by the number of microseconds per day, that is obviously wrong
> for the case when ts is negative (before 2000) because integer division
> (unlike floor ())  truncates towards zero...

Good catch.  It looks like Tom Lockhart changed this routine when he was
adding the int64-timestamp option.  He probably had a momentary brain
fade about the direction of rounding needed :-(

I've changed it back to doing things the 7.2 way in CVS tip.  This will
be in 7.3.4 unless Marc already wrapped the tarball, which I don't think
he did.

            regards, tom lane

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

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: Role Models Wanted
Следующее
От: Jean-Christian Imbeault
Дата:
Сообщение: SAP DB: The unsung Open Source DB