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 1qw3uF-009Jc8-VM for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Oct 2023 17:12:27 +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 1qw3uE-002g76-1i for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Oct 2023 17:12:26 +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 1qw3uD-002g6y-OK for pgsql-bugs@lists.postgresql.org; Thu, 26 Oct 2023 17:12:25 +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 1qw3u3-002RA8-6j for pgsql-bugs@lists.postgresql.org; Thu, 26 Oct 2023 17:12:24 +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 39QHCBVY1189852; Thu, 26 Oct 2023 13:12:11 -0400 From: Tom Lane To: Vik Fearing cc: zuming.jiang@inf.ethz.ch, pgsql-bugs@lists.postgresql.org, Alexander Korotkov Subject: Re: BUG #18170: Unexpected error: no relation entry for relid 3 In-reply-to: <4ecab120-6be3-4cf6-a2a0-249c73ae91d4@postgresfriends.org> References: <18170-f1d17bf9a0d58b24@postgresql.org> <4ecab120-6be3-4cf6-a2a0-249c73ae91d4@postgresfriends.org> Comments: In-reply-to Vik Fearing message dated "Thu, 26 Oct 2023 17:21:07 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1189850.1698340331.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 26 Oct 2023 13:12:11 -0400 Message-ID: <1189851.1698340331@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Vik Fearing writes: > On 10/26/23 16:01, PG Bug reporting form wrote: >> My fuzzer finds a bug in Postgres, which triggers an unexpected error. > This bisects to d3d55ce571369dad6e1d582f1655e5a3fbd8594a, Remove useless= = > self-joins. I wonder if that new code thinks it can remove ref_2 from the query, even though ref_2 is used in the targetlist. I'm not seeing control reach remove_leftjoinrel_from_query, though. Also, while nosing around in this, I tried to pprint(root) at the point of the error, and got 2023-10-26 12:48:37.852 EDT [1186007] WARNING: could not dump unrecognize= d node type: 37413808 This happens because the patch changed RelOptInfo.unique_for_rels from a list of Bitmapsets into a list of UniqueRelInfo, even though it did not bother to make UniqueRelInfo be a Node type (much less document the change in globally-visible data structures: pathnodes.h still says it's a list of Relid sets). This is not acceptable. I'm getting the distinct impression that this patch wasn't ready for prime time. regards, tom lane