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 1qdLQm-0031M6-G4 for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Sep 2023 02:04:40 +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 1qdLQl-00FsQ2-78 for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Sep 2023 02:04:38 +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 1qdLQk-00FsPa-Tu for pgsql-bugs@lists.postgresql.org; Tue, 05 Sep 2023 02:04:38 +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 1qdLQh-002mfM-M3 for pgsql-bugs@lists.postgresql.org; Tue, 05 Sep 2023 02:04:37 +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 38524XCr1237515; Mon, 4 Sep 2023 22:04:33 -0400 From: Tom Lane To: Richard Guo cc: fuboat@outlook.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18077: PostgreSQL server subprocess crashed by a SELECT statement with WITH clause In-reply-to: References: <18077-b9db97c6e0ab45d8@postgresql.org> <694541.1693600870@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Mon, 04 Sep 2023 11:01:41 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1237513.1693879473.1@sss.pgh.pa.us> Date: Mon, 04 Sep 2023 22:04:33 -0400 Message-ID: <1237514.1693879473@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > BTW, do you think get_name_for_var_field() has similar problem for > RTE_SUBQUERY case? The RTE_CTE code path in that function crawls up the > namespace stack before recursing into the CTE while the RTE_SUBQUERY > code patch does not, which looks like an oversight. Hmm, seems suspicious ... > I tried to find a > test case to show it's indeed a problem but with no luck. Note that any test case here would be of the form "dump a view or rule definition", not "EXPLAIN". What did you try? regards, tom lane