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 1okRJE-0000mR-8Z for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Oct 2022 14:41:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1okRJC-0000P5-Og for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Oct 2022 14:41:38 +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 1okRJC-0000Oi-Gd for pgsql-bugs@lists.postgresql.org; Mon, 17 Oct 2022 14:41:38 +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 1okRJA-0000xl-BE for pgsql-bugs@lists.postgresql.org; Mon, 17 Oct 2022 14:41: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 29HEfZlS2173461; Mon, 17 Oct 2022 10:41:35 -0400 From: Tom Lane To: Ilya Anfimov cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17646: create rule named "_RETURN" will cause pg core In-reply-to: <20221017143338.GA3864491@azor.tzirechnoy.ru> References: <17646-70c93cfa40365776@postgresql.org> <2164336.1666016275@sss.pgh.pa.us> <20221017143338.GA3864491@azor.tzirechnoy.ru> Comments: In-reply-to Ilya Anfimov message dated "Mon, 17 Oct 2022 17:33:38 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2173459.1666017695.1@sss.pgh.pa.us> Date: Mon, 17 Oct 2022 10:41:35 -0400 Message-ID: <2173460.1666017695@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ilya Anfimov writes: > On Mon, Oct 17, 2022 at 10:17:55AM -0400, Tom Lane wrote: >> (Although the core dump is also not great --- something should've noticed >> the bogosity of the plan earlier than this.) > Id doesn't look much of a plan bogosity, > but rather implicit deletion of the "_RETURN" on select rule. Right, but then since there's no applicable rule, we end up generating a plan that tries to do a seqscan directly on the view relation, which of course lacks storage. Something should notice that a little sooner than segfaulting because of rel->rd_tableam being NULL --- it's not like we don't have hundreds of other sanity checks for not-really- supposed-to-happen catalog corruption. In versions before v12, I get something like regression=# select * from v1; ERROR: could not open file "base/16384/49209": No such file or directory which is a shade less bad, but still not great. regards, tom lane