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 1nZsRb-0007Rf-Nn for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Mar 2022 10:54:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZsRZ-0004hh-CO for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Mar 2022 10:54:21 +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 1nZsRY-0004hX-Fv for pgsql-hackers@lists.postgresql.org; Thu, 31 Mar 2022 10:54:21 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZsRV-0003xk-B1 for pgsql-hackers@lists.postgresql.org; Thu, 31 Mar 2022 10:54:20 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 84102320201D; Thu, 31 Mar 2022 06:54:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 31 Mar 2022 06:54:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=fypZePwFe1Fg0Js0UdvQ/flCgIFp1yeGEEe26e3/nYc=; b=LC3RIZ5l Zvk670lrWrYRBQe2DlI0fmnH8Lnd/WIGmfMGFtTc+zDrw3p+By9EVp1DwkEyzzRB fYHLQ0LFExMFyN3c2UkPlpytdpNjikG7D/NgF7Y3R4wwwqnquDru5MunJbTC93ca xpV2tUo1Up7B4WUytOrueX8Mn9M54eEhlF92KaI9JyXcrlX71l2S44cz1TFbcWoF Lo7NXofjs3NrI7jC19p2Z5FMXYpwS2wmJF1JS9hGgEhplm6AFT/seKPQrhLVdlQK PMk+Wpu4Xr4U0QtYKKyaDweD9cozhLnn4Ujzy+kZI9Va6D8J5rDjwTofP3mqbJwS k0WEu4Eo9SJxqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeigedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedujeevjeffjeevuddutedvkeeiueeitddvieelfeekveej udefgeeuvdejhfeuleenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Mar 2022 06:54:12 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AF6222A08F0; Thu, 31 Mar 2022 07:54:36 -0300 (-03) Date: Thu, 31 Mar 2022 12:54:36 +0200 From: Alvaro Herrera To: Justin Pryzby Cc: Michael Paquier , =?utf-8?B?5p2O5p2wKOaFjui/vSk=?= , pgsql-hackers@lists.postgresql.org, =?utf-8?B?5pu+5paH5peMKOS5ieS7jik=?= , Zhihong Yu Subject: Re: CLUSTER on partitioned index Message-ID: <202203311054.fk6zeitz4nq5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I realized after posting that we used to allow clustering toast tables, but after my changes we no longer do. (Justin's version had a RELKIND_HAS_STORAGE test here instead, which seemed a little too lax.) I don't know why we allowed it and I don't know of anyone who has ever used that feature and we don't have any test coverage for it, but I don't have any reason to explicitly disallow it either. So I propose to continue to allow it: From 05ba6124422fb7c2fd19575e905e444ba3eef1e5 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 31 Mar 2022 12:49:57 +0200 Subject: [PATCH] allow to cluster toast tables --- src/backend/commands/cluster.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index 8417cbdb67..b391d7c434 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -451,7 +451,8 @@ cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params) } Assert(OldHeap->rd_rel->relkind == RELKIND_RELATION || - OldHeap->rd_rel->relkind == RELKIND_MATVIEW); + OldHeap->rd_rel->relkind == RELKIND_MATVIEW || + OldHeap->rd_rel->relkind == RELKIND_TOASTVALUE); /* * All predicate locks on the tuples or pages are about to be made -- 2.30.2 -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Java is clearly an example of money oriented programming" (A. Stepanov)