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 1whGRX-0007GR-04 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 00:47:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whGRV-003yHB-0z for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 00:47:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whGRV-003yH2-04 for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 00:47:13 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whGRS-000000008cI-24nU for pgsql-hackers@postgresql.org; Wed, 08 Jul 2026 00:47:13 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 04307140009B; Tue, 7 Jul 2026 20:47:09 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Tue, 07 Jul 2026 20:47:09 -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=1783471628; x=1783558028; bh=v0Grue3Zq9 9j9TSvoPhY1y4zJ1bV6pBkBEGp4VuXQto=; b=WMJmArnlGZDdFzPWticbeNDMzr I4dKjAW18dAfjt8wcLiP2YCZGQvtbWFD6LbI0zHyFYsK6gtT7SjbTXGyaTdCIqLZ EZ7/DgGndKqrnXBtAsc8DnBFN4++7NdB+cyTNAQCOL1rWUu5Bx/lNyBJMsee0aH4 6JV6Es649Zito/De+DNRhkddzDlh2ZHs6J1oGSekZ86ag6Map2zh1DQYFVQe9ph8 ygEOLufK4rkAqPC7mlD/EsYa8em1ntpY2+hhywL3aymh4hhO2XAstpUtSbmsGqJy 6LeDF4uKm6C0Nx7zjvwUlfqfKtqhLvhHgvGYanlErLBjF7v9aWe49ZXiD2fA== 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= 1783471628; x=1783558028; bh=v0Grue3Zq99j9TSvoPhY1y4zJ1bV6pBkBEG p4VuXQto=; b=UZrw3HmcfTSoIwjdZvF6389zdo2jdqAAJkMrVu1RKbjiPQg1fQL +e43wLohIlzxsC05TIC9QGA8os0EBOzPnp8JNo2C+ubTdhHDxwH28h/U4QEu48Mh EVYkJGEobpEAuuLbvtZZRV+q1P1yE0vAhKvKVKpHlH0utPwqum+cosVnvRqv6Yrn nMlMs9ETWEX2NDmLf91ODj/KyaQUpqv0TAXaP+Eae3cUUy9cxZ/Q+Opx9dtHYMlu 5BH3K83Pb2gpUzScP/74u4dF7INQiTmpe/X540RCicSzMBJ9dG4ITkJ7mGd2bf8a XYawLb0nALw9LBhi+NGq6X4jtsTw83aW7rw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGt4m++00kwaHQ66dba8CMKnJpm0D8HiqFW0P7+CAvCE9MxY1otVpJTT5k9Wh6K4b VzFOQ5q0vysiytW3Hl76wPPBx40E9t4x6lOqbk6+3OiNueN+Mu7CpADLmzvmBqkszT6SrV 7TJWPLUP8VP/xPoMvR8EuW5O/+QgznrXppH7n8Uhea9CKHb9aOJcsZGDoZCht5ND+qT5Wb Al+fOeQAFMX8bSVGMbXxMqk3+yiSEw8qqSVyMrdcHUzxazhEuQi4brgXRWJpMmpofAg6NO aYcoXjGOf8lMdrKadZu2mVWXC7HhhmWTKs/tZYy6Tz1YOJzR88e4ebfbLRyVnJ7vIa7ioP sLF9Oyob0vKVdrGxpKXf7+WijPbFK+w8WA2IjiDB8d6P/O+a+UxwLxn/u5YwpzHlrjKTfd 2OPswUms6ag07AQ62iwgyYUzFtTbzm0gR5WzDqHq2GOG+3jud89IJe+spL9HINEw8FA+hx FDUlDNwRj11dH7stH7c+wK4Hq25WJie29V5K9fHzprsi44mt/j1SRWlTkng4RZBrATNJs5 MczCeogft7UzgD+cZnXj76DaMPQ3V1kKjPrpJd882WErF7mQhB7rLcP+VIcnnxXvcdMkpG umP99gtEGSAqoGfDvcavaE86D97wwIvhXNIs3Icu6FVJdumFCtVm2Hz232tQ X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jul 2026 20:47:07 -0400 (EDT) Date: Wed, 8 Jul 2026 09:47:03 +0900 From: Michael Paquier To: Matthias van de Meent Cc: =?utf-8?B?0KLQtdGB0YLQvtCy0LAg0JXQutCw0YLQtdGA0LjQvdCw?= , pgsql-hackers@postgresql.org Subject: Re: VACUUM FULL or CREATE INDEX fails with error: missing chunk number 0 for toast value XXX Message-ID: References: <1779078055.630771314@fmail2.qdit> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sSknZgIIGtuGsWZT" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --sSknZgIIGtuGsWZT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jul 06, 2026 at 05:44:50PM +0200, Matthias van de Meent wrote: > I think this is insufficient; heap on-access pruning and btree's > aggressive index tuple removal (when the page would split) will still > cause some cleanup of data that could still be considered > RECENTLY_DEAD by a possible concurrent maintenance session (CREATE > INDEX, REINDEX, VACUUM FULL, ...). Reducing the likelihood of the problem won't address its root. While I looked into all that yesterday, I have looked at an approach based on a more aggressive detoasting for index builds, and it's pretty promising: https://www.postgresql.org/message-id/akyM9G67ZIhPXjmQ%40paquier.xyz The patch includes tests that emulate the report of this thread. The index build path should be able to live with the aggressive detoasting (we need them anyway for the index build). The CLUSTER/VACUUM_FULL/REPACK cases need a deeper chirurgy, as tuple rewrites for the copy_for_cluster() case may not need detoasting at all (case of tuples copied by reference, which is quite a common case when UPDATEs don't touch the external TOAST blobs, just other attributes). At least that's the assumptions the patch relies on. Please note that rather than re-creating a new CF entry, I've attached the other thread to your entry. It would be confusing to have two entries for the same problem. -- Michael --sSknZgIIGtuGsWZT Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmpNngcACgkQnvQgOdby QH30ng//cvz9kyIfhuRAfqFZVFCgJ9On1bzWF91ogRmearzLP9MVx5huQbRnI4b4 WxDlJ4XTtqlfkr/WmhIL6gj1zihbHMSNmWRMpIvt/BZjf5GhHG0DPpO7a4/H864A HS5ZsCiB9eC38Hcd3dVH0oGbYzPC4t6J+beVVWsDH9ecEHAsfqai336a0sqqVctT qu4H9Ljecs/T7YeYAwCCfQh3W8/IGiuAPoGIRPFqBWIhOX2zN1FFbH4cB1Yi4vmJ ZoKRBhwuHhmDBZGeMLv9wTK7T76nP1Sr8TZLqDvJ2uoihfJJjfunjlaD7+hC4PwF lJ7mC9gZLSchL6LZgxU86dpyjfe42PCpMrM5ctDmwVmg5HcCm39pPuQmGkc6ALaY R0obexieJtpoQHEnd6WK02lkXjf3mJo9T7Xfwv6UxYvQCNxbCaWCmz4XEbxYUe+E Z6Xloj0QClkrNCSsowr+NrKGI/y2RJig8yB+PSNnO3O5ShJr8QQlTAZgZm8UmJlx FCX6ijckd7LpGSpFoTttNJCisw10+rTmkJzX17bP+DJP51kSK6yDB9i84AT+pdlc Pzc9fD+Rh10xJKOC2Ivr8in0dBMjLTHoSY1UKpuZwVMPc4Bf1VmwDFkQGTXPUaFO r9jisWPaJbXsuZuGU9Jl5bvlQI4Z2yt649dIMRVaNVsB5YineZo= =G2xr -----END PGP SIGNATURE----- --sSknZgIIGtuGsWZT--