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.