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

Japin Li <japinli@hotmail.com>

From: Japin Li <japinli@hotmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Richard Guo <guofenglinux@gmail.com>, jiye_sw@126.com, pgsql-bugs@lists.postgresql.org
Date: 2022-10-11T16:16:37Z
Lists: pgsql-bugs

Attachments

On Tue, 11 Oct 2022 at 23:37, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote:
>> I think the basic problem is that the two calls of rewriteValuesRTE
>> are really dealing with fundamentally different cases, and we should
>> probably not have tried to make the same function do both.  I'm going
>> to try splitting it into two functions, one for the force_nulls case
>> and one for the !force_nulls case.
>
> As attached.  This seems *way* cleaner to me, even if it means we need
> two copies of the loops-over-VALUES-list-entries.  I didn't write a
> regression test yet, but this fixes the submitted bug and passes
> check-world.
>

Great.  LGTM.  Should we add the test-case for this?

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

Commits

  1. Yet further fixes for multi-row VALUES lists for updatable views.