pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Thomas Munro <thomas.munro@gmail.com>
To: Petr Fedorov <petr.fedorov@phystech.edu>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch
Date: Mon, 25 May 2020 15:28:54 +0200
Message-ID: <ee683994-8f7c-aded-be43-543e66e68b94@2ndquadrant.com> (raw)
In-Reply-To: <CA+hUKGK+K8NyS57tU841m1tSF6ha3W0udN2dw_Hbc=D_0OPbmA@mail.gmail.com>
References: <42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu>
	<CA+hUKGKgHUbFNKRhvodn4mVU-oqje+HA7jTg_XrWRo4UGhFoqg@mail.gmail.com>
	<18389.1575241151@sss.pgh.pa.us>
	<1c2262e2-6812-7baa-cbdd-63039db12952@phystech.edu>
	<CA+hUKGK+K8NyS57tU841m1tSF6ha3W0udN2dw_Hbc=D_0OPbmA@mail.gmail.com>

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).

One problem (other than perhaps performance, tbd.) is that this would no 
longer allow processing infinite timestamps, since numeric does not 
support infinity.  It could be argued that running extract() on infinite 
timestamps isn't very useful, but it's something to consider explicitly.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (47+ messages)  latest in thread

Message-ID: <ee683994-8f7c-aded-be43-543e66e68b94@2ndquadrant.com>
Permalink:  ../ee683994-8f7c-aded-be43-543e66e68b94@2ndquadrant.com/
Also on:    postgresql.org/message-id/ee683994-8f7c-aded-be43-543e66e68b94@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, thomas.munro@gmail.com, petr.fedorov@phystech.edu, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch
  In-Reply-To: <ee683994-8f7c-aded-be43-543e66e68b94@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox