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 1vjDvR-00BNQG-1Z for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 09:57:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vjDvO-00Gz9T-1m for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 09:57:54 +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 1vjDvO-00Gz9L-0f for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 09:57:54 +0000 Received: from udcm-wwu2.uni-muenster.de ([128.176.118.28]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vjDvL-000000004Hi-47CE for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 09:57:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-muenster.de; i=@uni-muenster.de; q=dns/txt; s=uniout; t=1769162272; x=1800698272; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=dqHZuEmjGyHmHZfCuvEWtkBZBI/XlGtzwlX0ihTvYmI=; b=bDN9XIX1GAqjGXqtZb55soIr8HU1Yuf9sdbKw95QwLk4tuC3FlPLXyz7 r4NjBtT17Piq4wxAoy6J5ChR17kNKD8tApeGaKPWi1I4uKw51vUQlurhI RP8r+bzt2wxZIV0JP5temn9C1KLF6Tf/zlXit7gueT6IzSRc/EkZCj4/4 6W75IB40QoIDJkTz2BQiP+uP4sKnYZrPUWoRzU5buMSB03PzL/nJ7qg/Z /iDDEHlxpIuCnfvNy/x5o6LR95moQaRN6Bqm/YGdjvP0eBaybndVNhrpX OiCSLJ4oEDnh5qV4vngSkQ5cVmMqMA2OhWCh4W62nW8fr9p/jpCBhesDy Q==; X-CSE-ConnectionGUID: 5UKJgCb+RU2a01dMq2wSoA== X-CSE-MsgGUID: FwgX/oeATPOh49DbM/DMkA== X-IronPort-AV: E=Sophos;i="6.21,248,1763420400"; d="scan'208";a="382229667" Received: from secmail.uni-muenster.de ([128.176.118.4]) by UDCM-RELAY2.UNI-MUENSTER.DE with ESMTP; 23 Jan 2026 10:57:51 +0100 Received: from [192.168.178.27] (dynamic-080-171-062-073.80.171.pool.telefonica.de [80.171.62.73]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTPSA id DE92220ADF00; Fri, 23 Jan 2026 10:57:49 +0100 (CET) Message-ID: Date: Fri, 23 Jan 2026 10:57:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: ALTER TABLE: warn when actions do not recurse to partitions To: Chao Li Cc: "David G. Johnston" , Greg Sabino Mullane , Postgres hackers References: <6eff5e43-cacd-4a2a-ad1d-e3b313c86050@uni-muenster.de> <950BB7B5-0180-4C36-82A0-7E17B920F740@gmail.com> <8ECD9403-F0BB-4971-94CF-2709EEB4E3B9@gmail.com> Content-Language: de-DE, en-GB From: Jim Jones In-Reply-To: <8ECD9403-F0BB-4971-94CF-2709EEB4E3B9@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 23/01/2026 01:11, Chao Li wrote: > I will wait to see the test results and address all issues together in next version. While testing some edge cases I found out that the NOTICE is being emitted too early in the code path, e.g. postgres=# ALTER TABLE m ALTER COLUMN b SET COMPRESSION pglz; NOTICE: ALTER action ALTER COLUMN ... SET COMPRESSION on relation "m" does not affect present partitions HINT: partitions may be modified individually, or specify ONLY to suppress this message ERROR: column data type integer does not support compression I'd argue that emitting only the ERROR message in this case would be the right approach. What about moving the EmitPartitionNoRecurseNotice() call to ATExecCmd, right **after** the changes were successfully executed? For instance, in the case I mentioned above, you could explore: @@ -5446,6 +5475,8 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, case AT_SetCompression: /* ALTER COLUMN SET COMPRESSION */ address = ATExecSetCompression(rel, cmd->name, cmd->def, lockmode); + /* Emit notice after validation passes */ + EmitPartitionNoRecurseNotice(cmd->subtype, rel, cmd->recurse, false); break; Not sure if cmd->recurse is propagated in this code path. If not, you might need to do it manually, e.g. @@ -4936,6 +4937,14 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, */ cmd = copyObject(cmd); + if (recurse) + cmd->recurse = true; + I'm not saying it should be exactly this way, but it sounds more reasonable to me to emit the NOTICE only if we know that the command is going to be successfully executed (or was successfully executed). This patch touches a lot of regression tests, but mostly to add the keyword ONLY to the ALTER TABLE statements, to avoid the NOTICE message, so that's ok. Thanks! Best, Jim