Re: BUG #17646: create rule named "_RETURN" will cause pg core - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17646: create rule named "_RETURN" will cause pg core
Date
Msg-id 2173460.1666017695@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17646: create rule named "_RETURN" will cause pg core  (Ilya Anfimov <ilan@tzirechnoy.com>)
Responses Re: BUG #17646: create rule named "_RETURN" will cause pg core
List pgsql-bugs
Ilya Anfimov <ilan@tzirechnoy.com> 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



pgsql-bugs by date:

Previous
From: Ilya Anfimov
Date:
Subject: Re: BUG #17646: create rule named "_RETURN" will cause pg core
Next
From: Ilya Anfimov
Date:
Subject: Re: BUG #17646: create rule named "_RETURN" will cause pg core