Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNJk7-00Axzu-Dl for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Jan 2024 21:34:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rNJk5-00FpP8-UD for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Jan 2024 21:34:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNJk5-00FpOz-Li for pgsql-bugs@lists.postgresql.org; Tue, 09 Jan 2024 21:34:37 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNJk3-000ico-9m for pgsql-bugs@lists.postgresql.org; Tue, 09 Jan 2024 21:34:36 +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 409LYVAs2228855; Tue, 9 Jan 2024 16:34:31 -0500 From: Tom Lane To: Richard Guo cc: David Rowley , zuming.jiang@inf.ethz.ch, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18277: Unexpected error: "WindowFunc not found in subplan target lists" triggered by JOIN and Window Func In-reply-to: References: <18277-089ead83b329a2fd@postgresql.org> <2063207.1704754792@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Tue, 09 Jan 2024 15:35:08 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2228853.1704836071.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 09 Jan 2024 16:34:31 -0500 Message-ID: <2228854.1704836071@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > On Tue, Jan 9, 2024 at 7:00 AM Tom Lane wrote: >> PG Bug reporting form writes: >>> My fuzzer finds a bug in Postgres 17devel, which triggers an unexpected >>> error "ERROR: WindowFunc not found in subplan target lists". > I think this is caused by that query_tree_mutator fails to mutate > runCondition for WindowClause. Ugh! That seems quite horrid. David, was there a reason to not do that, or was it just an oversight? > I think we should also consider WindowClause->runCondition in > query_tree_walker, expression_tree_mutator and expression_tree_walker. Offhand, +1. If it has the form of an ordinary expression tree then it really needs to be processed in all these places. regards, tom lane