Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whGnz-0007TP-2G for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Jul 2026 01:10:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whGnw-0044qN-0R for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Jul 2026 01:10:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whGnv-0044qE-14 for pgsql-bugs@lists.postgresql.org; Wed, 08 Jul 2026 01:10:24 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whGnt-000000004ei-2BUg for pgsql-bugs@lists.postgresql.org; Wed, 08 Jul 2026 01:10:22 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id D568DEC02A5; Tue, 7 Jul 2026 21:10:20 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Tue, 07 Jul 2026 21:10:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1783473020; x=1783559420; bh=KbO3FaGjHf UcLGY/gm0uIc8ZRt3CqozddcZiFsfEGTs=; b=BlcdoeNIPDFwi15onpp+P6LGaX 7IcwbMzzkFSO+UmDyx1nuNNXO6iNmEYPb/va56viT7IRt8fTAo/uS3eqscOFUu0B ghLJaEBgjmbwO53Dl006qU7o49ZPg0UHxd467sINBqM2qxU6AkWrU2wG8P3LaOcF 0tfsz2e4AO6KilrRfZKq+5ffJfb35hBUiLXUkGYtfedLZxGFX8LFmQdqiOBEnNbq PsoEmXm/IcmQXgq2dSX3VD8heT1F6GRxykzpd0CnQqLacyvOvoYTgLhp76LxkjEb S91rie644+4wXEO/GuK5/ZibGXUfOkRmqumT+3I+RAClkmlBBBSUzOn43wIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1783473020; x=1783559420; bh=KbO3FaGjHfUcLGY/gm0uIc8ZRt3CqozddcZ iFsfEGTs=; b=HqqVDqA+Hq+6Q8GPaDW/JyY2GQHOBGSUjk2AxyD2bc2iopsWk8w ne6WgjHSCtlx1AS/TyU0VxsMTFrjl09a//1GGJiX/XCHlUt9Bb1cfHcBJKL3AMCE MCxG4VY0h0iNaBRAdlO+3/vO1pl8LhumWNg4UzG53UFM6IB1nPs4kkrCnOM84yeq 2Dde7dRlVM5H63UvUe1zSxY83K77Yga5M1KP9dbP1SpPfCAd083IvUsJ8ufUzlFR wF4+18OjLEOZMmac7DsXlkrlYTrBTCbITIaF7zK9zg7Tzyv8TuvbeBxgGAejuz9h 79+dN5q5B/RzoZkzWerAa6KzD8STtYVOQ3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGbOitF6XdeT6AEnkwfiywJQ8zvRNTboD7awB5D9E4u+l1Qsn+pHBVGGE5/F2AL9v XYDdGaY9JRFQRuHqllRyHEATJtzQkt7DMxs3BJFveUCMo3R2hQE8sPvDYDgFwUOpOIuAsH wCrQDyb+QcQ9z9wb/pLnNnWVJKbh6lj1Umn7yu1xCgOBfyU0b6482QzerNIheGujxtpBKD eMQt6E+2oHfKvz8Y29AdzyO2Qm8XGOntWLC2B/VkmL5zCPAVioC0GRZFnY+oUzhLRuE52z UXZCOxqFx+42My0mEl5/4RdyUg452uhkZBttV5KKEcl+nawRjWJcSInl8UuXl/S0epkuZC M8LeWZYxDNTFkqku33GyCyUTKYlEEjW3XKsfGFJxIkw5yDI5dxyjIkGoQ+d8eITK74HwYQ naUtHJUAtchZ/x+I5ZwP8DFaikwddZ8he2QHQGm07pLZxq4oxQq+8Af+Jv92KZ4zSahODU 2U+IJQ8hJai1RtkXoF9RusCbSTrekNb0yPYNT5G2zsYq5ys4qFkE9sC8XZXLEAcH/6DsQk 1eG38h1QwA7/O9tEwgyS86BZ8tIfOxlPY/djeu/xowLWoKdiVLqONxhFT6yTfzzX7+e2Df nysxktaxm9aiSoUnA6kubr+VkMn+s9KXl/AQyHBMw3D5+aj9gIhGmE9wWcxw X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jul 2026 21:10:16 -0400 (EDT) Date: Wed, 8 Jul 2026 10:10:11 +0900 From: Michael Paquier To: Srinath Reddy Sadipiralla Cc: Matthias van de Meent , Imran Zaheer , Alexander Lakhin , PostgreSQL mailing lists , Konstantin Knizhnik Subject: Re: BUG #19519: REPACK can fail due to missing chunk for toast value Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ejyeCqjFabTtqsVV" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ejyeCqjFabTtqsVV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 08, 2026 at 07:15:16AM +0900, Michael Paquier wrote: > One thing that I still don't like much in the patch as written is my > use of a missing_ok argument, which feels super confusing as it > applies only to the underlying external TOAST, if the relation has > any. I'd be tempted to rewrite this portion of the patch with a > uint32 flags. Even if we assign one value for now (say MISSING_TOAST, > MISSING_TOAST_OK or whatever), it would allow more flexibility on ABI > grounds if we want more like states in the future across this portion > of the stack. Again, I strongly doubt that we will be able to > backpatch any of that. A couple of extra notes while I do not forget about that stuff.. The patch may be better split into two if we go with this approach, as the index build and rewrite paths require different solutions: - One for the rewrite path. It makes little sense to do any kind of aggressive early detoasting because it may be wasteful due to the tuple rewrites that update their data with only copies by reference (main relation tuple is rewritten, reuses the same external TOAST tuple). For workloads where UPDATEs do not touch the TOASTed attributes, that would be a waste. - One for the index build path, which is actually too aggressive with its early detoasting, now that I think about it. There should be no need to perform a detoast for anything else than the attributes that are used in the index definition or the attributes that are used in index expressions. So as written this patch would lead to a regression. -- Michael --ejyeCqjFabTtqsVV Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmpNo3MACgkQnvQgOdby QH2WRw/9FJ/ouKXPw0Djajy+YLKvWUmswSa2E1AznuLTvOw5iTtdKUXJd5Lr5Q/T YFyaQMMJy6IVcbxoEgUolBTbCUqM39qIhRwb+x0cA4tGNBeFq/Qv5lBW6oCrE4h0 S7Wos1tKc6G7Ub1vHTIh326gAr7yZVN/tVL4zT1ih7oVoUbyqrKLcxP/UYLIoBY8 8W4VT6wbOysptahbf5XTWaxDMAZ68zfXii5hgBRyEaKu7MkSPQNO6EF/FBePaeRM i5vC6JwdnDi8dF7UWxO8m5X0+LnIPXunhBqEx1jNl0fO8XeJyHa16LmkBXYfU6M0 EMEkEPPMa5fX9WZi1xD3bWCkW4nNKuYov9PGmAgfgXo9ges0pdonD9WOLs5RTPbD 6ToMIOBGtkR4GDY7Qsq5AQMPPFDnqOqzLxsZk5iSBIE5hN7tt65dMwJRBKWliTut Zw/3L+uA2hNme4BEbPd/bh3rUov+Rkf2pl2Axx6LQ70taypooHIxPtBe2TMybQ67 OWAZP2JyaFosgrgb/G+WaNwqkIU/RGRVm+VwiK95Qpkxhg3IPUsUnnIrrq0kDuHm 0P1xAt9hdGOURQLJhYbHvtHszWJhwpo3CBgasgxxG5HJSutCxQuXMx6TIHDzC27p 3txh/Wnxvl3PslZSLx1NOwMLKU6F4SV7QJHXvhEq2T1u3J9uttM= =wFBB -----END PGP SIGNATURE----- --ejyeCqjFabTtqsVV--