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 1lLmBC-0005gR-Vz for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Mar 2021 12:18:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lLmBB-0006ap-TN for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Mar 2021 12:18:37 +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 1lLmBB-0006ai-N0 for pgsql-hackers@lists.postgresql.org; Mon, 15 Mar 2021 12:18:37 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLmB7-00061P-8O for pgsql-hackers@postgresql.org; Mon, 15 Mar 2021 12:18:37 +0000 Received: from desktop.home.thelabyrinth.net (c-73-39-102-148.hsd1.va.comcast.net [73.39.102.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 95D5C546AD; Mon, 15 Mar 2021 12:18:30 +0000 (UTC) Subject: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch To: Peter Eisentraut , Tom Lane Cc: Pavel Stehule , Thomas Munro , Petr Fedorov , pgsql-hackers References: <1551357.1599435992@sss.pgh.pa.us> <097a4242-0748-98e3-06ab-ded1d366cd76@2ndquadrant.com> <1893468.1599658711@sss.pgh.pa.us> <38fc499a-ae52-efb6-aad6-82f812d6782d@2ndquadrant.com> <20200917055327.GU2873@paquier.xyz> <20200930071543.GL1996@paquier.xyz> <2fb99632-9302-6509-78ce-3aaed3fd7f40@2ndquadrant.com> From: David Steele Message-ID: <3ff4be02-1e2b-564f-9b53-3dc561da8218@pgmasters.net> Date: Mon, 15 Mar 2021 08:18:29 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <2fb99632-9302-6509-78ce-3aaed3fd7f40@2ndquadrant.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/15/20 9:03 AM, Peter Eisentraut wrote: > Here is a new patch for this.  This now follows the implementation that > Tom has suggested:  Leave date_part() alone, add a new set of extract() > functions, and map the SQL EXTRACT construct to those.  I have basically > just copied over the implementations from my previous patch and placed > them next to the existing date_part() implementations.  So all the > behavior is still the same as in the previous patches. > > One thing I still need to look into is how to not lose all the test > coverage for date_part().  But that should be fairly mechanical, so I'm > leaving it off in this version. Tom, what do you think of the updated patch? Regards, -- -David david@pgmasters.net