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 1w2Gt1-0008zh-0o for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 22:58:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2Gt0-00DxTX-02 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 22:58:10 +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 1w2Gsz-00DxTP-0t for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 22:58:09 +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 1w2Gsw-00000000VLO-0IcI for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 22:58:09 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id A070C1400076; Mon, 16 Mar 2026 18:58:03 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 16 Mar 2026 18:58:03 -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=fm1; t=1773701883; x=1773788283; bh=6dQXPSX5xr kuS2Mzu4i+W12T4v4sXMhtRz/t6cxooR4=; b=toJtOPBHQ1zfouFkmwZyC18G1V 75bwRYcjmOGgOZSGgHIGdrIYnQ261dtoB8bHziuIABPmlzik6GcZPe5jd3W2MfZ6 VTLus2+Vpvjm16V6rZDuS05DiarGS+dy3STFRYVDR5cJYCc9xrxByozrU7mGDPF9 21vY5SYdZDXwkIvBX3zFtUh79GgL33HE9QMJ7knyGK1+fUTUMP9fgR5B/PlVfwO6 V81/H8aA4SekBFvG9nhG7jEOqShcT3sIcPU+N4tsEE4xe++CZWQKzntJDIexdonD 06gKBFjhxViQhI2t/PSYmtt95rW9/+CptB7vMDw+dauxjU+loibjsCupbq9g== 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=fm1; t= 1773701883; x=1773788283; bh=6dQXPSX5xrkuS2Mzu4i+W12T4v4sXMhtRz/ t6cxooR4=; b=iVeEIkigsPFBxNSeOnd+AWcS1MhyUEggqpYkzEw8nxhkT2Tzozl Rfd9bgGAnnoAIcgZ4EXKsz4IrfqnBBt1WcHa4jVAg4pxBDK3VB5PQz7SqgHEtgR1 1Bp5xPnu94N9w3olCavPjLScdSAXrhDrAMxT/NVWW8bk55EIMfmbGqNcQfu0p8tZ tnFIE2l8XsnUnmlkB/QfOcSnoEOzWBzZJPDdP2iXk95Jbp7D4ID9XgyZuiecihyt lx0JnaT0URybtSkldXsS8Cqwaxi09fDm4xtMhSCAS6um4ha5hzbouAxwe8kXsHTB tcWRQPGtI72nLc56Dbou0p581jVtD10sTjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvleelieegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhird gvvhgrnhdrtghhrghosehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgr tghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Mar 2026 18:58:02 -0400 (EDT) Date: Tue, 17 Mar 2026 07:57:57 +0900 From: Michael Paquier To: Chao Li Cc: Postgres hackers Subject: Re: tablecmds: reject CLUSTER ON for partitioned tables earlier Message-ID: References: <16D5D52A-1B99-4371-982E-257C195D2924@gmail.com> <5244008D-79E1-484B-9407-21F5D388EC7F@gmail.com> <075DECA0-5214-4794-A265-5A979E1A49B7@gmail.com> <8A3FAABD-F297-41D1-9B07-20A37E311C29@gmail.com> <602D405C-63BC-4383-AD43-28841CAF91C1@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Dh+E22PSgqVMbgTu" Content-Disposition: inline In-Reply-To: <602D405C-63BC-4383-AD43-28841CAF91C1@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Dh+E22PSgqVMbgTu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 16, 2026 at 05:07:51PM +0800, Chao Li wrote: > Basically, 0002 does the same thing as 0001 just on a different > sub-command of ALTER TABLE. case AT_DropInherit: /* NO INHERIT */ [...] - /* No command-specific prep needed */ + ATPrepChangeInherit(rel); This change means that we are plugging in earlier a check based on a typed table for the NO INHERIT case. This sequence fails already on HEAD and with the patch, but generates a different error in the last query between HEAD and the patch, and is not covered by your patch: CREATE TYPE person_type AS (id int, name text); CREATE TABLE persons OF person_type; CREATE TABLE stuff (a int); ALTER TABLE persons NO INHERIT stuff; I'd suggest the addition of a test in typed_table.sql, just after the "ALTER TABLE persons INHERIT stuff;". The INHERIT case is already blocked, so NO INHERIT is a no-op anyway because we complain about the typed table not being inherited. How about doing that as a separate patch, with the second patch for tablescmds.c updating the regression test output? I thought that the NO INHERIT command was allowed, but we fail, so blocking it with a different, somewhat clearer error is OK by me. You are right that the comment on top of ATPrepAddInherit() is wrong, and that we'd better clean it up. The code does not do what the comment tells. That does not seem worth troubling stable branches. A second thing is that we'd better add an assertion in ATExecDropInherit() to make sure that this code path is never taken for a RELKIND_PARTITIONED_TABLE, ensuring that the prep phase blocked this case? -- Michael --Dh+E22PSgqVMbgTu Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmm4ivUACgkQnvQgOdby QH2ZjQ//VPDox3D0M8dqiNmYUV+u75m02YlB7f06tlkZQjRCUn099KtvL0LHctlx dr3lHb/XHNjfPDVW+FAJHiRniLVX42pItHnfUH7FStOMS8dz1XNvMfsiLJ9AyIIR W3NPzTe1QC9OG6kY9WhyxZPvSjn1tIJrBPUtRWRJc4BiBWfwGi302u+Xcmo+x/Jz hbyFWM/SZ4/1A3Rqgm75R6mEQj2I/9S1qI24MzoYmTWmFYZFDryX4LxtF/j4qXnv GfUEeSLpCI6KlCUBbneDb/lC2ZxQAg6DYTLAQFk0h3wBfzyEuDXso7DVrupkSc4e FsCx+hRLv9iFqd0yCBBaMEEwUfPTICI8H5OJaI4avrjRC6uT/+pSNoUWpJwBWnso SlLpkQFqI0mZJguEM8Ef6sEiQKH2Yi7mBDIYREP8Vy+Od9kfj/K9V3fUEXynJ82E M0VoL21H/MktPyBxdjTtaR8q15HfD1tTcRX5kEScAJbJDqBz2fH/QfpAAeIpJhzx fIQ+IHGbrhMUnsp2XBNwDcoj7IB9SnL9XH5OBwX4o6jX0Pvfv/PpJV5zqYz6VsSA pjCKdo+0b1usurYwDtXv6S0pBuSJN9sCQweScFGYrnxyzuhMb7r8ZoxS6E2XGi00 hTkI9F4+hxQTyW29VwfuoROIMIynbHWCgPU8Teo6rSJdKc1W0Dk= =bXDw -----END PGP SIGNATURE----- --Dh+E22PSgqVMbgTu--