Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHC73-0001mb-I4 for pgsql-docs@arkaria.postgresql.org; Sun, 15 Jan 2023 23:08:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHC72-0007QR-9u for pgsql-docs@arkaria.postgresql.org; Sun, 15 Jan 2023 23:08:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHC72-0007QI-2u for pgsql-docs@lists.postgresql.org; Sun, 15 Jan 2023 23:08:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHC6z-0007LJ-TA for pgsql-docs@lists.postgresql.org; Sun, 15 Jan 2023 23:08:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 30FN8L6r1747093; Sun, 15 Jan 2023 18:08:21 -0500 From: Tom Lane To: Andres Freund cc: Laurenz Albe , suchithjn22@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: The documentation for storage type 'plain' actually allows single byte header In-reply-to: <20230115230320.d3mtlzek6dv7mgxx@awork3.anarazel.de> References: <167336599095.2667301.15497893107226841625@wrigleys.postgresql.org> <1698750.1673818827@sss.pgh.pa.us> <20230115230320.d3mtlzek6dv7mgxx@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sun, 15 Jan 2023 15:03:20 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1747091.1673824101.1@sss.pgh.pa.us> Date: Sun, 15 Jan 2023 18:08:21 -0500 Message-ID: <1747092.1673824101@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund 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