Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WhtyO-00035I-Rm for pgsql-bugs@arkaria.postgresql.org; Wed, 07 May 2014 05:00:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WhtyO-0005Su-4R for pgsql-bugs@arkaria.postgresql.org; Wed, 07 May 2014 05:00:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WhtyN-0005Sn-7c for pgsql-bugs@postgresql.org; Wed, 07 May 2014 05:00:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WhtyK-0002xM-8f for pgsql-bugs@postgresql.org; Wed, 07 May 2014 05:00:50 +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 s4750kN9015054; Wed, 7 May 2014 01:00:46 -0400 From: Tom Lane To: Jeff Davis cc: pgsql-bugs@postgresql.org Subject: Re: can insert timestamp value that can't be read In-reply-to: <1399415471.27807.49.camel@sussancws0025> References: <1399415471.27807.49.camel@sussancws0025> Comments: In-reply-to Jeff Davis message dated "Tue, 06 May 2014 15:31:11 -0700" Date: Wed, 07 May 2014 01:00:46 -0400 Message-ID: <15053.1399438846@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) 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 Jeff Davis writes: > It looks like timestamp[tz]_pl_interval() is not doing proper validation > in all paths. > Patch attached. I looked for other areas that might be affected, but > none jumped out. This seems to be adding a heck of a lot of cycles (viz, replacing a simple int64 or float8 addition with timestamp2tm then tm2timestamp) to fix a corner case that will probably not matter to anyone anytime in the next 200 thousand years, give or take a few millenia. I'm okay with the concept of detecting overflow here, but not at this price. Can't we do a more direct overflow check, comparable to what ordinary int64/float8 addition does? Also, surely timestamp_mi_interval has got the identical issue, and probably some other operators. 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