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 1kFv95-00022n-UK for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Sep 2020 08:08:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kFv92-00030C-2k for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Sep 2020 08:07:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFv91-000305-8b for pgsql-hackers@lists.postgresql.org; Wed, 09 Sep 2020 08:07:55 +0000 Received: from forward3-smtp.messagingengine.com ([66.111.4.237]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFv8y-0000Zq-JI for pgsql-hackers@postgresql.org; Wed, 09 Sep 2020 08:07:54 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.nyi.internal (Postfix) with ESMTP id B53771941A9D; Wed, 9 Sep 2020 04:07:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 09 Sep 2020 04:07:50 -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=fm3; bh=rIYroMYPLKayP2X0oZRoRC941FqdFNNOIWYTxhG7I VI=; b=pBZWwBnFI+C5LRonsNEMyvCRwMO/x04r/ZkI0yVpAAkQACxTZOvWJime2 nO0Iy3zCFEQQ1tGSB4bwqyqqa1Z8cxnKV0nZvu7FYUbz+KNwSDFvLvOHs/qOnNUv iVWgt7JoeVZlsqchRjtiNKU8vhPNIUMMWx1Vfn8FjhHWuiYRm7SJuwZPiJ5bz9A+ hjFJaDs3ajgdDNIGDohgGnp7qO3lOdYsDnjPFDcRBQYmeO+wxevCKl4pxHDh6sNU dt023zo/eb5yhcPEgCFq8EIdpy4hkOm5+vxI3y7NhPrDo+eR4bzmdsEgxRcaDprB R54kt3h3dQjGQ5R5TabtSlDLz725Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehgedgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhfhokffffgggjggtgfesthejredttdefheenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsedvnh guqhhurggurhgrnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeevueetledvuedugffg vedugeduhfdvkeegueefhfdtgeeuudeghfehueegfefhieenucffohhmrghinhepvdhnug hquhgrughrrghnthdrtghomhenucfkphepledurddugedrvdeffedrfeefnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghish gvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhm X-ME-Proxy: Received: from april.pezone.net (p5b0ee921.dip0.t-ipconnect.de [91.14.233.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 484473280059; Wed, 9 Sep 2020 04:07:49 -0400 (EDT) Subject: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch To: Tom Lane References: <42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu> <18389.1575241151@sss.pgh.pa.us> <1c2262e2-6812-7baa-cbdd-63039db12952@phystech.edu> <1551357.1599435992@sss.pgh.pa.us> Cc: Pavel Stehule , pgsql-hackers , Thomas Munro , Petr Fedorov From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <097a4242-0748-98e3-06ab-ded1d366cd76@2ndquadrant.com> Date: Wed, 9 Sep 2020 10:08:06 +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: <1551357.1599435992@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; 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 2020-09-07 01:46, Tom Lane wrote: > Peter Eisentraut writes: >> Here is a new patch series version. >> I have created a new internal function for converting integers to >> numeric, to make the implementation a bit more elegant and compact. > > I reviewed the 0002 patch, finding one bug (in int8_sum) Ouch, no test coverage. Should we perhaps remove this function, since it's obsolete and unused? > and a few > more calls of int8_numeric that could be converted. I think the > attached updated version is committable, and I'd recommend going > ahead with that regardless of the rest of this. I hadn't realized > how many random calls of int8_numeric and int4_numeric we'd grown, > but there are a lot, so this is nice cleanup. Yes, please go ahead with it. > I continue to think that we can't commit 0003 in this form, because > of the breakage that will ensure in stored views. As I said upthread, > we should leave the existing SQL-exposed functions alone, invent > new ones that return numeric, and alter the parser to translate > EXTRACT constructs to the new functions. This approach would also > provide an "out" for anyone who does complain about the performance > cost --- they can just continue to use the old functions. Okay, I will continue looking into this. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services