Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
От | Japin Li |
---|---|
Тема | Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error. |
Дата | |
Msg-id | MEYP282MB1669B5146A97FCD8D18A75EFB6239@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM обсуждение исходный текст |
Ответ на | Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error. (Richard Guo <guofenglinux@gmail.com>) |
Ответы |
Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
|
Список | pgsql-bugs |
On Tue, 11 Oct 2022 at 21:16, Richard Guo <guofenglinux@gmail.com> wrote: > 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: >> >> 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. > After some more thinking, I find the previous cannot work correctly. For example: CREATE OR REPLACE v1_r AS ON INSERT TO t1 DO ALSO SELECT * FROM t2; > 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); > Oh, I think this might not be true. The product query comes from rules, which might be a SELECT query, IIUC. See above example. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.
В списке pgsql-bugs по дате отправления: