Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPBDU-00034O-6k for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Jan 2017 16:48:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cPBDS-0002Di-Vi for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Jan 2017 16:48:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cPBDR-0002Cy-VK; Thu, 05 Jan 2017 16:48:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cPBDO-0003ao-U1; Thu, 05 Jan 2017 16:48:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v05GmRt7005119; Thu, 5 Jan 2017 11:48:27 -0500 From: Tom Lane To: Vitaly Burovoy cc: Pantelis Theodosiou , web+postgresql@modin.io, pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [HACKERS] Re: [PATCH] BUG #14486: Inserting and selecting interval have different constraints In-reply-to: References: <20170104150301.10134.9126@wrigleys.postgresql.org> Comments: In-reply-to Vitaly Burovoy message dated "Thu, 05 Jan 2017 08:07:54 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5117.1483634907.1@sss.pgh.pa.us> Date: Thu, 05 Jan 2017 11:48:27 -0500 Message-ID: <5118.1483634907@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Vitaly Burovoy writes: >> I've written a patch which fixes that bug (in attachment). >> Should it be registered in the CF? > Oops. Forgot to attach the patch. Fixed. I suspect that many of these SAMESIGN() tests you've added are not actually adequate/useful. That's only sufficient when the output could be at most a factor of 2 out-of-range. If it could overflow past the sign bit then you need to work harder. (By the same token, the existing SAMESIGN test in interval2tm is wrong.) Possibly we should consider alternatives before plowing ahead in this direction, since adding guards to interval_in and interval computations doesn't help with oversize values that are already stored in a database. We could think about replacing interval2tm's output format with some other struct that uses a TimeOffset for hours and so cannot overflow. I'm not sure though how far the effects would propagate; it might be more work than we want to put into this. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs