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 1oqkM0-00059k-OS for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Nov 2022 00:14:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oqkLz-0002lR-Ks for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Nov 2022 00:14:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqkLz-0002lI-Cl for pgsql-bugs@lists.postgresql.org; Fri, 04 Nov 2022 00:14:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqkLw-0003nw-N5 for pgsql-bugs@postgresql.org; Fri, 04 Nov 2022 00:14:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2A40ES2P2198599; Thu, 3 Nov 2022 20:14:28 -0400 From: Tom Lane To: Vik Fearing cc: pgsql-bugs Subject: Re: Wrong result with constant quals In-reply-to: <309137b4-9b48-5952-c6e1-0fa7007d0419@postgresfriends.org> References: <2193245.1667518580@sss.pgh.pa.us> <309137b4-9b48-5952-c6e1-0fa7007d0419@postgresfriends.org> Comments: In-reply-to Vik Fearing message dated "Fri, 04 Nov 2022 00:56:56 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2198597.1667520868.1@sss.pgh.pa.us> Date: Thu, 03 Nov 2022 20:14:28 -0400 Message-ID: <2198598.1667520868@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Vik Fearing writes: > I allowed for this by saying it could be a single group with no rows if > you preferred to look at it that way. That is exactly what the standard says. > This does not explain why the WHERE FALSE is being ignored and producing > rows. It's not ignored, but it applies to the pre-grouping rows, of which there aren't any to remove. But there's still a group. regards, tom lane