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 1lttLY-0006wF-Qi for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Jun 2021 14:50:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lttLX-0008CE-ER for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Jun 2021 14:50:19 +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 1lttLX-0008Ac-7K for pgsql-bugs@lists.postgresql.org; Thu, 17 Jun 2021 14:50:19 +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 1lttLV-0003u2-18 for pgsql-bugs@lists.postgresql.org; Thu, 17 Jun 2021 14:50:18 +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 15HEoExn972633; Thu, 17 Jun 2021 10:50:14 -0400 From: Tom Lane To: blo.talkto@gmail.com cc: pgsql-bugs@lists.postgresql.org, Peter Eisentraut Subject: Re: BUG #17061: Impossible to query the fields of the tuple created by SEARCH BREADTH FIRST BY .. SET .. In-reply-to: <17061-dd7f4825b7da3a9d@postgresql.org> References: <17061-dd7f4825b7da3a9d@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 17 Jun 2021 11:44:28 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <972631.1623941414.1@sss.pgh.pa.us> Date: Thu, 17 Jun 2021 10:50:14 -0400 Message-ID: <972632.1623941414@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk [ screwed up the cc somehow the first time, sorry for the duplicate ] PG Bug reporting form writes: > WITH RECURSIVE mtree(id, name) AS ( ... > ) SEARCH BREADTH FIRST BY id SET breadth > SELECT (breadth)."*DEPTH*" > FROM mtree m; > ERROR: CTE m does not have attribute 3 Yeah, I get that with "SELECT (breadth).*" as well. I'm not entirely sure what this silly-looking syntax is supposed to mean, but it seems to be adding an output column named "breadth" to the CTE. The error is occurring because said column has not been added to the relevant CommonTableExpr struct. Peter? regards, tom lane