Hi,

On 2023-01-15 16:40:27 -0500, Tom Lane wrote:
> The documentation is correct, what is broken is the code.  I'm not
> sure when we broke it

Looks to be an old issue, predating the slot type stuff. It reproduces at
least as far back as 10.

I've not thought through this fully. But after a first look, this might be
hard to fix without incuring a lot of overhead / complexity. We check whether
projection is needed between nodes with tlist_matches_tupdesc() - targetlists
don't know about storage. And we decide whether we need to project in
nodeModifyTuple solely based on

        /* Extract non-junk columns of the subplan's result tlist. */
        foreach(l, subplan->targetlist)
        {
                TargetEntry *tle = (TargetEntry *) lfirst(l);

                if (!tle->resjunk)
                        insertTargetList = lappend(insertTargetList, tle);
                else
                        need_projection = true;
        }

Greetings,

Andres Freund


Reply via email to