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 1qeALl-005xxT-PD for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Sep 2023 08:26:54 +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 1qeALk-00GyoU-8A for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Sep 2023 08:26:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qeALj-00GyoJ-Pc for pgsql-bugs@lists.postgresql.org; Thu, 07 Sep 2023 08:26:51 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qeALf-003bhr-66 for pgsql-bugs@lists.postgresql.org; Thu, 07 Sep 2023 08:26:50 +0000 Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 4EA70E20F83; Thu, 7 Sep 2023 11:26:45 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1694075205; bh=A1u4Hx2mgMdnDfd+7a55ArxYGkGPHa9A4R85/jfTDlE=; h=User-Agent:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:From; b=RZn1ioC/mCxBbWnDx2MuBnVw/WW6wby1WOjQJCSrfu8yvZtoPx0LI6SFxSFx0GVji o6OHsjklT0qGuCnzUXbkGpzeNw8lxVGQL5vUHw5N5Crm1bU6o2tkZeM+NxVkB1q2Hu aworSuBh3xQ+IfrgDx91NBm+OrlTG8Q/Kl3dZnZwEYfbMsDH3zTc2frTni17YG7FaU Xvy0yJWCbsWBRw0kwvI/3/bHlG92qrF3zYKWvFQQKupFb02skhzX/YMy+PJeR03xMM wV0dxSA9liSPGjqDFDry6nGhNPwMukBwmvIqBTeyE4Ej+tsmmD/N7V2iIKlB66dowE eDiLqrOJd7YWw== Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 4F38127C0054; Thu, 7 Sep 2023 04:26:43 -0400 (EDT) Received: from imap53 ([10.202.2.103]) by compute1.internal (MEProxy); Thu, 07 Sep 2023 04:26:43 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehhedgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvvefutgfgse htqhertderreejnecuhfhrohhmpedfnfgvphhikhhhohhvucetnhgurhgvihdfuceorgdr lhgvphhikhhhohhvsehpohhsthhgrhgvshhprhhordhruheqnecuggftrfgrthhtvghrnh eptedugeekgeekhfdvkedtiefffedvteefieejveelffeftdehffduhfevgeelkedvnecu ffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehlvghpihhkhhhovhdomhgvshhmthhprghuthhhphgv rhhsohhnrghlihhthidqudefleeghedujeehvddqfedttdeitdekfedvqdgrrdhlvghpih hkhhhovheppehpohhsthhgrhgvshhprhhordhruhesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ie8b149e1:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id BB2C688005E; Thu, 7 Sep 2023 04:26:42 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-711-g440737448e-fm-20230828.001-g44073744 Mime-Version: 1.0 Message-Id: <3933834e-b657-4ad1-bf4e-5f3fbba7ba14@app.fastmail.com> In-Reply-To: References: <18077-b9db97c6e0ab45d8@postgresql.org> <694541.1693600870@sss.pgh.pa.us> <1237514.1693879473@sss.pgh.pa.us> <3f7bcdb7-c263-4c06-a138-140f5c3898ed@app.fastmail.com> Date: Thu, 07 Sep 2023 15:25:36 +0700 From: "Lepikhov Andrei" To: "Richard Guo" Cc: "Tom Lane" , fuboat@outlook.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18077: PostgreSQL server subprocess crashed by a SELECT statement with WITH clause Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Sep 6, 2023, at 1:55 PM, Richard Guo wrote: > On Wed, Sep 6, 2023 at 11:40=E2=80=AFAM Lepikhov Andrei=20 > wrote: >> Hi, >>=20 >> I am writing here just because you change this specific part of code. >> Designing a custom node I found the problem with CTE and Subqueries. = The reproduction sample looks quite similar to yours: >>=20 >> create view tt24v as >> with cte as materialized (select r from (values(1,2),(3,4)) r) >> select (r).column2 as col_a, (rr).column2 as col_b from >> cte join (select rr from (values(1,7),(3,8)) rr limit 2) ss >> on (r).column1 =3D (rr).column1; >> explain (verbose, costs off) select * from tt24v; >>=20 >> but fails with the error "failed to find plan for CTE ..." with a cus= tom node over a JOIN.=20 > > The error message indicates that something must have gone wrong. I > don't know well enough about custom scan, but I cannot reproduce this > error with your query. Am I missing something? I invented a dummy extension "pg_extension" [1], commit 4199a0c, which a= dds CustomScan over the first non-parameterized HashJoin at the pathlis= t. The example presented in my letter earlier causes the ERROR on CTE. More= over, if you remove the word 'materialized', you will find the same erro= r on Subquery. [1] https://github.com/danolivo/pg_extension/tree/main --=20 Regards, Andrei Lepikhov