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 1rSHD6-00CazU-4C for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Jan 2024 13:53:04 +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 1rSHD5-00D9mU-9E for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Jan 2024 13:53:03 +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 1rSHD5-00D9mI-0l for pgsql-bugs@lists.postgresql.org; Tue, 23 Jan 2024 13:53:03 +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 1rSHD2-002y6O-8f for pgsql-bugs@lists.postgresql.org; Tue, 23 Jan 2024 13:53:01 +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 40NDqtx63968321; Tue, 23 Jan 2024 08:52:55 -0500 From: Tom Lane To: Richard Guo cc: zuming.jiang@inf.ethz.ch, David Rowley , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18305: Unexpected error: "WindowFunc not found in subplan target lists" triggered by subqueries In-reply-to: References: <18305-33c49b4c830b37b3@postgresql.org> <3738975.1705938286@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Tue, 23 Jan 2024 18:41:41 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3968319.1706017975.1@sss.pgh.pa.us> Date: Tue, 23 Jan 2024 08:52:55 -0500 Message-ID: <3968320.1706017975@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > Hmm, is there a way to detect in find_window_run_conditions() whether > the WindowFunc's argument references a SubLink node of a subquery that > hasn't been pulled up? contain_subplans will recognize both SubLinks and SubPlans, so there must be some other factor here. (I didn't look yet.) regards, tom lane