Re: The documentation for storage type 'plain' actually allows single byte header - Mailing list pgsql-docs

From Andres Freund
Subject Re: The documentation for storage type 'plain' actually allows single byte header
Date
Msg-id 20230115230320.d3mtlzek6dv7mgxx@awork3.anarazel.de
Whole thread Raw
In response to Re: The documentation for storage type 'plain' actually allows single byte header  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: The documentation for storage type 'plain' actually allows single byte header  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-docs
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



pgsql-docs by date:

Previous
From: Tom Lane
Date:
Subject: Re: The documentation for storage type 'plain' actually allows single byte header
Next
From: Tom Lane
Date:
Subject: Re: The documentation for storage type 'plain' actually allows single byte header