strange TIME behaviour

Поиск
Список
Период
Сортировка
От rihad
Тема strange TIME behaviour
Дата
Msg-id 46EBC5BE.40601@mail.ru
обсуждение исходный текст
Ответы Re: strange TIME behaviour  (Ron Johnson <ron.l.johnson@cox.net>)
Re: strange TIME behaviour  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
Can someone please explain to me why these two give different results?
The idea is to get the number of seconds past 00:00:00, so the second
one is obviously correct.

foo=> select extract(epoch from current_time);
   date_part
--------------
  42023.026348
(1 row)

foo=> select extract(epoch from cast(current_time as time));
   date_part
--------------
  60030.824587
(1 row)


Isn't current_time already a time? Why is the cast necessary?

Thanks.

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

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: getting min/max of two values
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: strange TIME behaviour