Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
Дата
Msg-id CAMbWs491JOKxnc3f3XGj1oYAzi=OJP6=YjUZnQ=hAUxo3BF+hQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.  (Japin Li <japinli@hotmail.com>)
Ответы Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.  (Japin Li <japinli@hotmail.com>)
Список pgsql-bugs

On Tue, Oct 11, 2022 at 8:29 PM Japin Li <japinli@hotmail.com> wrote:

On Tue, 11 Oct 2022 at 20:09, Richard Guo <guofenglinux@gmail.com> wrote:
>
> I think the problem exists for auto-updatable view, as we leave the
> DEFAULT items untouched because we expect to apply the underlying base
> rel's default.
>
> In this case there is a rewrite rule on the view.  Applying the rule
> we'd get a product query whose target entries referring to the VALUES
> RTE have attribute 3 and 4 while the relation has only two attributes.
> Then we proceed to replacing the remaining DEFAULT items with NULLs.
> And when we try to access the relation's 3rd and 4th attributes, we are
> accessing illegal memory areas.
>

Yeah, I also notice this, attch a patch to fix it.
 
+1 for the idea. We need to identify the right target relation for each
product query and rt_entry_relation is not the right one.

A minor comment is can we know the product query is not CMD_SELECT?
If so I suggest we add an assertion before fetching the target relation,
something like:

Assert(pt->resultRelation != 0);

Thanks
Richard

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Japin Li
Дата:
Сообщение: Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17634: Inconsistent view_definition in information_schema.views