strange TIME behaviour

From: rihad <rihad(at)mail(dot)ru>
To: pgsql-general(at)postgresql(dot)org
Subject: strange TIME behaviour
Date: 2007-09-15 11:45:02
Message-ID: 46EBC5BE.40601@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2007-09-15 12:15:10 Re: strange TIME behaviour
Previous Message Geoffrey Myers 2007-09-15 11:24:26 Re: NOT NULL Issue