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

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

> 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.

It appeared to me that it was failing at this step in
ExecGetInsertNewTuple:

        if (relinfo->ri_newTupleSlot->tts_ops != planSlot->tts_ops)
        {
            ExecCopySlot(relinfo->ri_newTupleSlot, planSlot);
            return relinfo->ri_newTupleSlot;
        }

ri_newTupleSlot has the tupdesc we want, planSlot is a virtual slot
that has the bogus tupdesc, and for some reason heap_form_tuple is
getting called with planSlot's tupdesc not ri_newTupleSlot's.  I'm
not quite sure if this is just a thinko somewhere or there's a
deficiency in the design of the slot APIs.

The UPDATE path seems to work fine, btw.

            regards, tom lane



pgsql-docs by date:

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