Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
От | Tom Lane |
---|---|
Тема | Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error. |
Дата | |
Msg-id | 312797.1665500865@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | 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.
|
Список | pgsql-bugs |
Japin Li <japinli@hotmail.com> writes: > On Tue, 11 Oct 2022 at 21:16, Richard Guo <guofenglinux@gmail.com> wrote: >> +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. > After some more thinking, I find the previous cannot work correctly. Yeah. The product query might not be an INSERT at all, yet rewriteValuesRTE is assuming it is --- that whole business of scanning the targetlist for referencing Vars and then saving their resnos doesn't make sense otherwise. 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. The force_nulls case shouldn't really need a target_relation parameter in the first place (since it has no business assuming that the query is an INSERT). I think it should just replace each SetToDefault with a NULL of the same type as the SetToDefault, and call it good. regards, tom lane
В списке pgsql-bugs по дате отправления: