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

From: Japin Li <japinli(at)hotmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: jiye_sw(at)126(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
Date: 2022-10-11 12:29:16
Message-ID: MEYP282MB1669B7492DAFE6913C127ED8B6239@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On Tue, 11 Oct 2022 at 20:09, Richard Guo <guofenglinux(at)gmail(dot)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.

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

Attachment Content-Type Size
fix-trigger-cache-lookup-failed.patch text/x-patch 892 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2022-10-11 13:16:54 Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
Previous Message Richard Guo 2022-10-11 12:09:30 Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.