Re: BUG #17803: Rule "ALSO INSERT ... SELECT ..." fails to substitute default values

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17803: Rule "ALSO INSERT ... SELECT ..." fails to substitute default values
Date: 2023-02-25 15:08:25
Message-ID: CAEZATCU2UquVrzrjEPyos6TVrymhaOBM_BM6ymPkmrBf_nQrrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 24 Feb 2023 at 16:53, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> It might be worth doing
>
> + if (rte->rtekind == RTE_SUBQUERY && !rte->lateral &&
> + contain_vars_of_level((Node *) rte->subquery, 1))
> + rte->lateral = true;
>
> so as to save the expense of contain_vars_of_level() when the flag
> is already set. However, it's arguable that no users would bother
> with writing LATERAL, so this might be pointless.
>

OK, maybe not essential, but that does seem more consistent with what
we do in other places.

> More importantly, I think the comment could do with a bit more
> information. Maybe like ...
>

Yeah I thought about adding more detail to that comment, but couldn't
come up with the right set of words. That looks reasonable to me.

Pushed.

Regards,
Dean

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2023-02-25 16:00:00 Re: BUG #17803: Rule "ALSO INSERT ... SELECT ..." fails to substitute default values
Previous Message Tomas Vondra 2023-02-25 13:37:39 Re: two bugs