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 1vkQMK-00EuYn-2h for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jan 2026 17:26:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vkQMJ-009gmk-1k for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jan 2026 17:26:39 +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 1vkQMJ-009gma-0b for pgsql-hackers@lists.postgresql.org; Mon, 26 Jan 2026 17:26:39 +0000 Received: from mail-yx1-xb135.google.com ([2607:f8b0:4864:20::b135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vkQMG-002QeM-2F for pgsql-hackers@lists.postgresql.org; Mon, 26 Jan 2026 17:26:38 +0000 Received: by mail-yx1-xb135.google.com with SMTP id 956f58d0204a3-6495d592c45so3316769d50.2 for ; Mon, 26 Jan 2026 09:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769448396; cv=none; d=google.com; s=arc-20240605; b=VslnZy49qOqaE4kiUXaYmYKwwsMUVBsgshbewn5TdE+vuKK5DH62GGXBuvUe6R2j99 O6uN0JR2r+vovRdCodMbtAqklDCKUROGF4nhcBjYocEdrtTveC2PFRTSYXqddpGhYNAX C0VJUMdR87sBesYbQ9TS36ZyiGKTsKwH/K6rojys9WFy9DEmivU7z8KSL6Zsfe5AgHJS IE/u6gTKld2D24bolBtZbbU9W58TlmJQ+PSDNnPW//kpdTajHrC5kUIZc20TT74MIqBB SFZMjATZ67zSb2dFbUsDUil1tl2OX8HZccZ6ekQKF9ofSL3sPLQ+EGMJCWxXJB4t2I5v f9Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=yppymfsb9fw/DPBwb18y+zvDgawr85jvEGw0WXS2vh4=; fh=API7pHFvHz//VzzmsjMiZjVU2agzigd09gVcY4RidXg=; b=HhoLOBoTJzKRXWiwLQCRORxABU4Vtoykbeq6DL22UCaMvnjqrXw7gvfQJxSbfSruN8 sUypP/Ai2fkmmKUNxPSOuo8DyCwLiZsCR3mR3A3dBb+wqI+P+AjeOJj8mHZcAFG7HNJ0 CAMbvb1xAim1xnvL3zS0qQ1HkUD3E6ADEQjlJJYoHnBkweDj3CHEYL5YMWVgAlZ3gUwO VsjlgL8byX/JTMLB+++1u7KpAp6ntVUcXY+6qCw/wkB7HS00d5g5YT/hKIuHcfu6rjid UPsJP9/zrq0HcdFBs38rm5/xeEn/bEDnIGg4OFjMZhoMpL+EDj1kmo4DNytvKHk7ynv9 /Aow==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1769448396; x=1770053196; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yppymfsb9fw/DPBwb18y+zvDgawr85jvEGw0WXS2vh4=; b=XUKbZhhPgs7A4aH+0YyYF0SXFJW1y+y9qgt2o2yKRyWpL3QY4jtomY+68Y5reif8HR DGwUlulkJrkutDucCMEvlYc+loG2gYMOttm6XYV/DgYNwhFPrN3IaeSSvBK1O5w8aHXm Bu0fDepHPSQy3T3a8raVyNuIISnJEFMcPA7bQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769448396; x=1770053196; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yppymfsb9fw/DPBwb18y+zvDgawr85jvEGw0WXS2vh4=; b=e1kTGY5AygTulnT2fw+Atk2A3C8YROjRjQCLBglMaeaToQgEagaPWa+MJoDaRpoROB sHrDnGsioV+1EZdp4DxNKp3i9H8JtnKOKiwGxLFdm6Qg07/5CQjQIHRjVjE+iasxWqrm loEcVYtvQFMtGgCRczqV0WfS6SN70rDD9mEUmIhgIUKTdjklY/UMl4QD0vYqlaA3eH62 FxBxBIDG9rCSm81FydKqtGqYDms2vmAh45E/qDnqJFzKNuNCx+ZKNEuyM1YFjuFAYyxb xN2i151HtzyM62CZdgtSGBFaRPcTLko59H5hVnYWBIYtRGtrb0+YpV79Oc04WdUVbmr7 sp2g== X-Gm-Message-State: AOJu0Yy95sfGR1rYveGkwq51nRr8JVHKKRa/5ldOSfdxOnippbEBQ6V2 j1b6ASPgfIAVeJPlL0c4XnwsbScL5y8gLHYfptlag2q6zNJh3Bm+wJ9vkfcfWP/85XT6hgBv+xJ YxHj8gTIYHNwjaHDuxlaISh32PJPfsgrj+wDqCBW2DOz5wC+RIPlhFpLOjejQ/G1yRWVLkZcuw1 JOeR1v+w4a9aqBsp5yEr8mn26rei2WW+u/sBejyAP3FBsy6UajfNWcS8aDMuiXPHnR0N+gsRBS7 VCspQyyMVtRKPh8X0lkT/dQ4De50ZPwKBv54pl/FV0cNzwaMcaqkz84eWPDYiNwE3w= X-Gm-Gg: AZuq6aI0O70+5Kz/hgvVGfJjb538NfrT2dBnAUEPMog1F1TTT6mOCfQMO+DNlxGrP+W Dd9jN2FG8wzmKKUBrH44PX8Oxw2fl8QDlLzNTzAKt0x9AY2igOwCzb/4aBoBmK2WgTMdtWh8CT0 9epeg200OHPYIV8UJtbBjUk/fuG+y/croqnKoUjDNaypDsIsXj3JYubwXfkoOZkBdj7sod6FI49 zVN3mYeiVQk9fwk/CQeXEfDhZBTaVri7XX4xkviVIbC3160HQuYO3s1MZwBuHlQcd0efwZI8Gdk z2b74VbZAQGrdNZmS8zFpLSJScK7pkI2DIYf5HOiB6RyrHFWfnPNMkJ8 X-Received: by 2002:a05:690c:c50e:b0:793:ad65:fe2a with SMTP id 00721157ae682-7945a8488b6mr36717387b3.12.1769448396344; Mon, 26 Jan 2026 09:26:36 -0800 (PST) MIME-Version: 1.0 References: <07773235-2E94-478F-BEF6-38C73B0553B8@gmail.com> <16D5D52A-1B99-4371-982E-257C195D2924@gmail.com> In-Reply-To: <16D5D52A-1B99-4371-982E-257C195D2924@gmail.com> From: Zsolt Parragi Date: Mon, 26 Jan 2026 17:26:26 +0000 X-Gm-Features: AZwV_Qir_BbpJ039_a4cgEmoh7M0xWpPaotJMudZHTA2TjCu162t9exg9kXMuUc Message-ID: Subject: Re: tablecmds: reject CLUSTER ON for partitioned tables earlier To: Chao Li Cc: Postgres hackers Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk +ALTER TABLE nonpartitioned INHERIT partitioned; -- ok ERROR: cannot inherit from partitioned table "partitioned" -- cannot add NO INHERIT constraint to partitioned tables That comment should be fail Otherwise the patches look good. The rest is about the two checks that seem redundant to me - I don't have a problem with leaving them as is, but they do seem redundant to me. > So, I would leave the check there, maybe use a separate discussion for removal of the check. I tried to find a way to trigger it and couldn't figure out anything, to me it seems unreachable. > However, there is a call path: vacuum -> vacuum_rel -> cluster_rel -> rebuild_relation -> mark_index_clustered. I am not sure if the check plays some role there. VACUUM FULL always passes InvalidOid to the cluster_rel for the index parameter, so we can't hit the error. CLUSTER is more difficult to follow, but to me that also seems like to never hit this error, and the behavior I see is also described in the documentation (mark_index_clustered is only called for leaf partitions, where it works). Following the calls in the code also shows the same to me, that this method is now only called for partitions. > No, the check is not redundant. It checks for child partitions, while ATPrepChangeInherit only blocks partitioned tables. And I have the same issue with this one: I modified that error in ATExecDropInherit to an assertion locally. The test suite had no new failures, I also tried to write a few tests manually, but I wasn't able to trigger it. Maybe I'm missing something, but I think it's redundant now.