Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdDAE-0007Ph-N3 for pgsql-hackers@arkaria.postgresql.org; Mon, 25 May 2020 13:29:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jdDAD-0002c1-JR for pgsql-hackers@arkaria.postgresql.org; Mon, 25 May 2020 13:29:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdDAD-0002bt-CV for pgsql-hackers@lists.postgresql.org; Mon, 25 May 2020 13:29:09 +0000 Received: from wforward4-smtp.messagingengine.com ([64.147.123.34]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdDA5-0000ba-Gp for pgsql-hackers@postgresql.org; Mon, 25 May 2020 13:29:08 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id ABE45D47; Mon, 25 May 2020 09:28:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 25 May 2020 09:28:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=njmdsi2owCwYo1kJ2H67BZSv9VkXzEgVpniF/hdc5 2s=; b=uOAroGaYLkQF0rifMUwxTiiLSAKIikoeEzAsniaYa5Q3wfvJ+1iqrVKl6 nHIALELWbRbBx9cZeCzGKcxnOLNe76HGqm5W/MM+mmAn7xBk57VvYqTY1cfcIW/1 1n2vVf2YP/Zp7yFm29T5NrD6HpVBQGJB1PBsCrtXfaOyXLDhNpwoG+rOZjcCnWZZ 4HuP8RNwzDNkPVamAvQA4erkVqgvk1sIdF0XqrGmxJacC8fvGBXYDQU/GwkkiMl4 UXJnFuYMsX9r4g5vkCMtz1N6XUBGxQR7d2XJ1D/OpqQ40q6fnmS+vnAOBLJ8oj5b 89iua9jWn//iEQujrH/lGGQXA1ddQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvtddgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhohfkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnug hquhgrughrrghnthdrtghomheqnecuggftrfgrthhtvghrnheptdevgeehtdejvdevvdel jeeuveejjedtleelgfekleefieekjeelgfektdduuedvnecuffhomhgrihhnpedvnhguqh hurggurhgrnhhtrdgtohhmnecukfhppeelfedrvdegfedrkedvrddvgeeinecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghish gvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhm X-ME-Proxy: Received: from april.pezone.net (p5df352f6.dip0.t-ipconnect.de [93.243.82.246]) by mail.messagingengine.com (Postfix) with ESMTPA id 224F530664B8; Mon, 25 May 2020 09:28:56 -0400 (EDT) Subject: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch To: Thomas Munro , Petr Fedorov References: <42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu> <18389.1575241151@sss.pgh.pa.us> <1c2262e2-6812-7baa-cbdd-63039db12952@phystech.edu> Cc: Tom Lane , pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Mon, 25 May 2020 15:28:54 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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