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

Tom Lane <tgl@sss.pgh.pa.us>

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

Attachments

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.

			regards, tom lane

Commits

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