Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFTeQ-0004sD-K9 for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Nov 2017 23:32:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFTeP-0008Kk-Qx for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Nov 2017 23:32:53 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eFTeP-0008Ka-Bp for pgsql-bugs@lists.postgresql.org; Thu, 16 Nov 2017 23:32:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eFTeM-0002Wx-MZ for pgsql-bugs@postgresql.org; Thu, 16 Nov 2017 23:32:52 +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 vAGNWnZ4013087; Thu, 16 Nov 2017 18:32:49 -0500 From: Tom Lane To: jens.with@t-online.de cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14913: Test for aggregates fails In-reply-to: <20171116224401.1466.68649@wrigleys.postgresql.org> References: <20171116224401.1466.68649@wrigleys.postgresql.org> Comments: In-reply-to jens.with@t-online.de message dated "Thu, 16 Nov 2017 22:44:01 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13085.1510875169.1@sss.pgh.pa.us> Date: Thu, 16 Nov 2017 18:32:49 -0500 Message-ID: <13086.1510875169@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk jens.with@t-online.de writes: > *************** > *** 1575,1583 **** > select percentile_disc(array[0,0.1,0.25,0.5,0.75,0.9,1]) within group > (order by thousand) > from tenk1; > ! percentile_disc > ! ---------------------------- > ! {0,99,249,499,749,899,999} > (1 row) > select percentile_cont(array[0,0.25,0.5,0.75,1]) within group (order by > thousand) > --- 1575,1583 ---- > select percentile_disc(array[0,0.1,0.25,0.5,0.75,0.9,1]) within group > (order by thousand) > from tenk1; > ! percentile_disc > ! ----------------------------- > ! {0,100,249,499,749,900,999} > (1 row) > select percentile_cont(array[0,0.25,0.5,0.75,1]) within group (order by > thousand) Odd. Given the lack of similar reports, it must be something rather platform-specific. I'm afraid you're going to have to do some of your own sleuthing. Just looking at the code, it seems like this might be explainable as a roundoff-error problem, if somehow (double) 0.1 times 10000 gives a smidge more than 1000. But I wouldn't really expect any modern platform to get that wrong. Unless maybe you're using -ffast-math, or some other accuracy-sacrificing compiler option? BTW, that test has been there since 9.4. Which earlier versions of PG have you successfully tested on the same platform? regards, tom lane