fixes for date_part micro/millisecond precision

Поиск
Список
Период
Сортировка
От Brent Verner
Тема fixes for date_part micro/millisecond precision
Дата
Msg-id 20011124135615.A8009@rcfile.org
обсуждение исходный текст
Ответы Re: fixes for date_part micro/millisecond precision  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Hi all,

  This patch fixes a problem where extract/date_part returns bad values
for microsecond and millisecond parts.  Patch is attached.  I'm not
sure if the solution is correct, but it cures this symptom.

before:
========
brent=# select date_part('milliseconds','2001-11-24 13:49:12.826833-05'::timestamp);
    date_part
------------------
 826.833000000001
(1 row)

brent=# select date_part('microseconds','2001-11-24 13:49:12.826833-05'::timestamp);
    date_part
------------------
 826833.000000001
(1 row)


after:
========
brent=# select date_part('milliseconds','2001-11-24 13:49:12.826833-05'::timestamp);
 date_part
-----------
   826.833
(1 row)

brent=# select date_part('microseconds','2001-11-24 13:49:12.826833-05'::timestamp);
 date_part
-----------
    826833
(1 row)

cheers.
  brent

--
"Develop your talent, man, and leave the world something. Records are
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Support for QNX6, POSIX IPC and PTHREAD-style locking
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Chinese NLS patch, the third try.