Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost whenextracting epoch

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost whenextracting epoch
Дата
Msg-id 9a680979-ad76-4c3b-1bc0-403152cf49dc@postgresfriends.org
обсуждение исходный текст
Ответ на Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost whenextracting epoch  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 5/25/20 3:28 PM, Peter Eisentraut wrote:
> On 2019-12-02 23:52, Thomas Munro wrote:
>>> I'm not an expert in floating point math but hopefully it means that no
>>> type change is required - double precision can handle it.
>> Me neither, but the SQL standard requires us to use an exact numeric
>> type, so it's wrong on that level by definition.
> 
> I looked into this (changing the return types of date_part()/extract()
> from float8 to numeric).

I think what would be better is to have a specific date_part function
for each part and have extract translate to the appropriate one.  This
is particularly interesting for epoch but it would also allow us to
return the correct type mandated by the spec.

(I would also accept a specific date_part per return type instead of per
part, that would probably even be better.)
-- 
Vik Fearing



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

Предыдущее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: password_encryption default
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch