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 1wr9Xg-000BE8-1z for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Aug 2026 07:26:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wr9Xe-003mWN-1c for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Aug 2026 07:26:26 +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 1wr9Xd-003mW7-22 for pgsql-hackers@lists.postgresql.org; Tue, 04 Aug 2026 07:26:26 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wr9Xa-000000009Wf-1KFI for pgsql-hackers@lists.postgresql.org; Tue, 04 Aug 2026 07:26:25 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 6C9A21D00181 for ; Tue, 4 Aug 2026 03:26:20 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Tue, 04 Aug 2026 03:26:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm1; t=1785828380; x= 1785914780; bh=M78WwaXB5qOf57qmTHjDLzQYIaxmiB2Gc3jTKyIQY1I=; b=b 30dI2sp1/7mSP71g1BEXne2shsJNlmRT2pTOR9hIFiZ21XlOzSg3egw4r3CL/J76 /WVZr5B02dTlAGqWlM6/zf4PimoEaLVuhO2F+oElB4MbN0vDEcnoLVihLJ5799lE Tge75ci+m7doWR2cKVYQfjRusueQzjDdMYYOWJXqNRkcGnNRLRyNnbuwxsWyHKAl kDwudcxFKAPe1PRN3Eo2xB+OMt4CWPf714Ty1atcVsmOGTmjZvp5fEnVS04Jc9oO gJAPfiG2XIE7/9SsNTf4G0ZtQOkPi+AZPxzoJegioamIHNKLuyauJALma0sGz6rM 2coVbyvWh+GvTZHPwlyxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1785828380; x=1785914780; bh=M78WwaXB5qOf5 7qmTHjDLzQYIaxmiB2Gc3jTKyIQY1I=; b=Oqj5c7Dlw5KdjSEYFGO6YgF4ckPlD xj/zslsRldeObqqQdpJ6a6HRpfiokvz5KJdSUokXsIsAW0xsgmrwEhQPelNQLHgw 769lNTAx4THhMkCNkjBela5S86ZRWwLrK4RJEjqg4jg8zxHDR/ksSm4wwNH6y+OG rAeFvipQpzOGao2i2fwbdCj0o5/5Y/Oi1pa2dx7Yj/lqOE4LTEZl07kAfu0FPcjs IwYi4/gbbFVFoCW9a9CgnThdqy5qnE2mPRWN7S8TkPbLlT3cvxritgpxuiKEkHTD zzTJChoddiyqSmm7Ovpn+YS/aKAPIhPkWkBdvJe3f8wI5vkP1ZBNip8YA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTE7yFWaQBsO86gcKaiZstjFP4gkJ9REhGPYY5vye3aNnsUdw/i8zn3Yun/yRsh3St scQWqEUtG6lngUKtGlPWj2wjljViFOyCq0U82etngscKT/fxcMhVV/7FdLlN83zK0Jvzml H5zN6fVohETux/Lkb2Q3tESSrWq+dJ2rcESbjJUj8n15SHfZmWn5JbFEFj2dTap2/hrDn6 ewh756tIx7lSJaI7QGW3z7dHhSrjBCvCwsAAxA1IkZ/FbcHdfprUllAzGScKQIUUeukGPY owooM4nXGHpK2lKq6WCcwIOlIVSvRrrsJzGqx44co5ZAWbQVwGCaI86ukx16EekGPg2ED9 1cRPe3lU5GcMyK7T1yt3NOc81xmKfJ0AYZICA4hFAU/nKpss7svq2Ny2cCd52i3PJVLBOm 7Jfwsc2oL3hB7Pg45XtLfMpJUms8GJAhJZQuKzEeELw07MchD7VuuRgSPEhqXE6lHMyxNd 4Leb2WYBDgVPps1f6Dw9QJfa4S7pzT+GaWh87EEujttXrXP+RKnI9EnA7prOsdvVXaA93m nyMMBji7VjdH63nMRR0q8eHdAVu5F7GrPwpEUY8bvGcWpZOyR0iyc+OWYeGTT2E5aN4l66 JxsxEAPH04YTVwlv5AYwvCxYL4/4tWNEyE9GOTP3lT+Cd0FKXQy9VtduPkVw X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 4 Aug 2026 03:26:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1785828376; bh=XIGeJGo+vE07R5CUUSu/BbWcFTsyEY1QN3i+Tt3BIas=; h=Date:From:To:Subject:In-Reply-To:From; b=t5I0m1cB85YBwT5bjn8rSe5QHWJiojZCbpN5TD88fDFz/0IfVSuzNYdWbOhh38n9y BLeyMNRPU7cFwyo8jpiZLtbcR0MQAAhNKP4qQJLBw5dFiDZGIIpWAfhB5EBRDe6N0k dIcKttRW0U2cpcgY50K4sWtsvhs5f6IcjUML1Z3+zTENlzfzHDx1P0K2CIPMZBKXJi fmJoGG/aQRYHYVLo0Q1obbWc45DtsamZBIsHYgK6R2YbeZ4uy+EgAttnCbqK01v/ej wqfEtBhxSo2GTBKbbz6jpWU+ydrW/Vw3lYcBIRFQQ8dn/aQAXH4m9LELDwjybpuHJG da/TJOiB3OFpw== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 742CEB001AF; Tue, 04 Aug 2026 09:26:16 +0200 (CEST) Date: Tue, 4 Aug 2026 09:26:16 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: pgsql-hackers@lists.postgresql.org Subject: Re: Fix ALTER COLUMN ... DROP EXPRESSSION with subpartitions Message-ID: 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 Hello Alberto, On 2026-Apr-07, Alberto Piai wrote: > While working on [0], I noticed that DROP EXPRESSION currently refuses > to be applied to inheritance trees of depth > 2, e.g. when there are > subpartitions. Yep, confirmed. > PFA a fix for this and a test case. > > I added the test case to generated_stored.sql, Looks good. I pushed your fix, with two minor changes: 1. acquiring a lock in the find_inheritance_children() call is confusing and unnecessary, because ATSimpleRecursion already did it, so I removed that by passing NoLock. 2. I removed the comment that suggested that the functionality could be implemented with some effort. This was foreclosed by 8bf6ec3ba3a4, so the comment is false and wrong. I also moved the test to the exact spot where ALTER TABLE DROP EXPRESSION is being tested. That gave me the perfect placement for the corresponding test for the legacy-inheritance part of the functionality. The backpatch was pretty straightforward (mostly because git-cherry-pick figured out by itself that it needed to apply the generated_stored.sql patch to generated.sql at the point where it was renamed.) I think you didn't add a commitfest entry for this. Please don't forget to create one for every patch that you submit; otherwise they're likely to fall through the cracks. (Though these days the CF process seems more and more to be a mostly useless, abandoned chore.) Thanks! -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ It does it in a really, really complicated way why does it need to be complicated? Because it's MakeMaker.