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 1pcsqF-00030S-9W for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Mar 2023 19:00:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcspF-0000iN-2F for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Mar 2023 18:59:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcspE-0000iE-Pz for pgsql-bugs@lists.postgresql.org; Thu, 16 Mar 2023 18:59:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcsp8-0004hk-8W for pgsql-bugs@lists.postgresql.org; Thu, 16 Mar 2023 18:59:43 +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 32GIxYpO3962535; Thu, 16 Mar 2023 14:59:34 -0400 From: Tom Lane To: David Rowley cc: xinwen@stu.scu.edu.cn, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c In-reply-to: References: <17826-7d8750952f19a5f5@postgresql.org> <402866.1678378153@sss.pgh.pa.us> <1229467.1678555436@sss.pgh.pa.us> <1616392.1678657435@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Wed, 15 Mar 2023 00:13:41 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3962533.1678993174.1@sss.pgh.pa.us> Date: Thu, 16 Mar 2023 14:59:34 -0400 Message-ID: <3962534.1678993174@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Mon, 13 Mar 2023 at 10:43, Tom Lane wrote: >> Ah, got it. So basically, the quals that we want are excluded by >> check_output_expressions' point 4 (since they reference window >> function output columns rather than partitioning columns). I think >> we need them to satisfy every other property that's checked in this >> code, though. Now I agree that we need to refactor a bit -- we >> don't want to have to re-check all of these conditions. > OK, patch attached. This looks good to me. As a matter of style, I'd capitalize the enum constant names, but I think it's OK otherwise. > I probably need to do a bit more indenting work. I'll look again tomorrow. Yeah, this looks like pgindent might not like it as-is. regards, tom lane