Richard Guo <guofengli...@gmail.com> writes: > On Sun, Jan 7, 2024 at 6:41 AM Tom Lane <t...@sss.pgh.pa.us> wrote: >> Thanks for the report! I guess we need something like the attached.
> +1. Pushed, thanks for looking at it. >> I'm surprised that this hasn't been noticed before; was the case >> really unreachable before? > It seems that this case is only reachable with Vars of an INSERT target > relation, and it seems that there is no other way to reference such a > Var other than using CTE. I'm a little uncomfortable with that conclusion, but for the moment I refrained from back-patching. We can always add the patch to v16 later if we find it's not so unreachable. (Before v16, there was no find_base_rel here at all.) regards, tom lane