Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIbTP-00009x-K0 for pgsql-bugs@arkaria.postgresql.org; Fri, 02 Nov 2018 15:34:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gIbTN-0006ZA-EM for pgsql-bugs@arkaria.postgresql.org; Fri, 02 Nov 2018 15:34:57 +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.89) (envelope-from ) id 1gIbTN-0006Z1-83 for pgsql-bugs@lists.postgresql.org; Fri, 02 Nov 2018 15:34:57 +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.89) (envelope-from ) id 1gIbTL-0003R1-6X for pgsql-bugs@postgresql.org; Fri, 02 Nov 2018 15:34:56 +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 wA2FYk9m032177; Fri, 2 Nov 2018 11:34:47 -0400 From: Tom Lane To: =?UTF-8?Q?Ond=c5=99ej_Bouda?= cc: Andres Freund , pgsql-bugs@postgresql.org Subject: Re: Wrong aggregate result when sorting by a NULL value In-reply-to: <30923.1541171251@sss.pgh.pa.us> References: <2a505161-2727-2473-7c46-591ed108ac52@email.cz> <30923.1541171251@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 02 Nov 2018 11:07:31 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32175.1541172886.1@sss.pgh.pa.us> Date: Fri, 02 Nov 2018 11:34:46 -0400 Message-ID: <32176.1541172886@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > =?UTF-8?Q?Ond=c5=99ej_Bouda?= writes: >> the following seems as a bug to me on Postgres 11.0: > Yeah, somebody broke this between 10.x and 11.0. ... > I've not looked at the code yet, but it's acting like somebody changed the > STRICT logic from "are any of the aggregate's arguments null" to "is any > part of the whole row (including ordering values) null". Wrong ... git bisect fingers this: commit 69c3936a1499b772a749ae629fc59b2d72722332 Author: Andres Freund Date: Tue Jan 9 13:25:38 2018 -0800 Expression evaluation based aggregate transition invocation. Andres, do you have time to look at this right now? regards, tom lane