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 1wCPcA-001xRn-0Y for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 22:18:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCPc7-008rrf-2N for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 22:18:40 +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 1wCPc6-008rrW-2X for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 22:18:40 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wCPc5-00000000sIy-20OR for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 22:18:38 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 768F77A017D; Mon, 13 Apr 2026 18:18:36 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Mon, 13 Apr 2026 18:18:36 -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=1776118716; x=1776205116; bh=77qoLJrB4c E+ji5dHRzO9mOvaGmEki9hiFdpZh20R4o=; b=Lflfp5Pv7CXd86pibWhCMNhApe FnFSMZk0I/4NC4eJRpC1qYQajsS/Flf+V4eaXXZQOk0lGDTS1upiBn3J0Ijv6s3i tigC4S7Up3Vox3N/J3B2nh1xsTPbEu6kQfvZThSoMnfHl1PP77KoeA3UJD9XZsPI c4Ljg9d3AO27H0gVZoRmiq9zvNpU4Tg+xADekmbD7nVv+SnnGsI34nZvyKRI8XWk SF5jM1n/xJPhP10OUPM2ZxiYHrZM9yqgEcIpVzHaEX5QctVUJYNCoxQmQOlwn/12 Xsp/VzS0fsySVh9c7STAbRSUKl3bJe7P1xqbJxs5m20tpEyU8FM9+J8LkVXA== 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= 1776118716; x=1776205116; bh=77qoLJrB4cE+ji5dHRzO9mOvaGmEki9hiFd pZh20R4o=; b=hCJDSSvAsg7p8E/1/ay7f6PdkgIHUFEoW112B33OGcg1HzQ61JW T2lBIU1x4fvpe9FigWGbaRetZPO1wg0U91T+cRR/mhBf719yB1LdblVnA6unPqBb 3BsKUGZbIgaGfRijG5/BqEgNlnVXJwrqu6dOxuc6cKmdgngskxdBJB4MpOZp/y5E uXAGcsOUYnQJ7jmOJ+qWs+encQtZpFLlXXdPwMb4hSl50QhgvTqQlDlWScAgESan Toyl8Mh4G/TMR0U228//XnGhYXCqZMzHoiZo49sfnNfsKHh9QvJIJIIl6l4PJGBk ocyMnmXKAAHM8PX02X8o4y961hZJO6dgbdg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdefleegvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehsrghmih hmshgvihhhsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhrihhsthgrnhdrhihimhes ghhmrghilhdrtghomhdprhgtphhtthhopehmohgrlhhirdhpghesghhmrghilhdrtghomh dprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgv shhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Apr 2026 18:18:35 -0400 (EDT) Date: Tue, 14 Apr 2026 07:18:33 +0900 From: Michael Paquier To: Sami Imseih Cc: Haibo Yan , Mohamed ALi , pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Fix: Partitioned parent index remains invalid after child indexes are repaired Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VH5ehgyZk0//JUtB" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --VH5ehgyZk0//JUtB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Apr 11, 2026 at 11:10:54AM -0500, Sami Imseih wrote: > I don't think that a REINDEX should attempt to set the parent index indisvalid. > It seems the responsibility for this falls squarely on the ATTACH > PARTITION command, > as it currently does. Relying on REINDEX is not optimal, as it would mean that all the partitioned indexes would need to be updated before flipping the flag. If the indisvalid flags of the partitions are already true, this would be a huge waste of resources. > Would the right solution here be to try to have the ATTACH PARTITION check if > the parent index is not valid, then validatePartitionedIndex() ? This may be a backpatchable thing, even if it requires one to detach one partition before attaching it again, or attach a fake partition to force a flip of the flag, before detaching this fake partition. One better alternative that I could think of is a new flavor of ALTER TABLE, like a ALTER TABLE foo VALIDATE PARTITION (no partition name here) focused on flipping the indisvalid flags? This would not be backpatchable, but it would make the whole flow lighter by not requiring a redefinition of one partition. -- Michael --VH5ehgyZk0//JUtB Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnda7kACgkQnvQgOdby QH0tTw/5AR9dcSrwaae/LT4UMFscghQ9xSeFOEvLu0FzIqqJa686yfkW++FXj6ZY 0XvuQTn6ilZrhA9Rk/JTuWffIozkn6HDLh95KeXSb+05A2hAIUcFqx8E326trFxD Cwd17wQttZ5p1zpRoIyJ8byOKqR90OVCXB5wyZWl1umc8+1huMulXODFd3EWvtRp /QFKC/Ui4Ql1wISuJRX0D89nh5NWHIBOjb+0WjJLKWuOP3Jv+RPtSakNRlcR5PFa a1EZFkXch65K3P7BRjKWat8MlYThfrEEoz8V6Eyc+ovxdja2UAyAV/Z0ucM+CK4X 1xHjJY+0VxGVS8SzGopyf0xyD1n+aiTpNftR86xJ1W1JLvK2tK17932XZ2fE9f5+ 0vtt8YSFwG8qVbcmMvGhbu2anygpHhEB2n/xKTRaT6z4NNmSPxC1i9v9QuvI+LW1 4picVVe+ao2ezDTciXnxkrmzIEf10zWlknf8XvmL8s7P/Raso7xOMTOfckuaOrqk OslMtyyeonv6q6aLvD8YPcRwi1Ou2OkVxXKD0+OcOBPBWm1JSQaRPsVE+aeoJ+p1 lLiG0ImnE//qqAHy1++cLDGH45dVk2mvx2JkpnkN6up+dV9TFrfxWU87YwOa1oPp PvkPBZDIaE47iBdyEexyxft6vo1yLUcOe0+77qkb+Jpt2XsjYME= =LoTi -----END PGP SIGNATURE----- --VH5ehgyZk0//JUtB--