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 1vfcNi-003QtA-1K for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jan 2026 11:16:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vfcNg-004SJH-25 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jan 2026 11:16:12 +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 1vfcNg-004SJ9-0x for pgsql-hackers@lists.postgresql.org; Tue, 13 Jan 2026 11:16:12 +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.96) (envelope-from ) id 1vfcNe-000ChH-14 for pgsql-hackers@lists.postgresql.org; Tue, 13 Jan 2026 11:16:12 +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=1768302970; x=1799838970; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=1527U3KOdHAzxFp71wIylTrxoUgAPynKHd0Aw1CJ2r4=; b=BXYsVrK00rt6CqKr4pXOabACtlnutzu1Bxs7Q6XiuOeDja9wS7SOR0Mm 8+O3EjKrjK24caS65El3vI++NAAJSYkMgwfxte49NJa4hmkYm4WuKG8A0 XUv0H0ujMLuA0lQcKyZLEGNqp2vzCzgZKpBBwnLXfQfuQA1H+oODKnGES +kSyDKneO6oaeuMrcnVwey/NVEMROYUJnV0zMhmd8tvhTlnRy44xv+jwH aOvImjUPQiJP3feaRd70KdBz64JolWyTMGiMuS73OOwf+PjREGNn2uwnt F9utqodh9uQYYy2us4IZzeCgGwCGtiJx3g6S3YsdQ7VSpC8LsnRbUK6r2 A==; X-CSE-ConnectionGUID: SO4okIYaS5GE1zQiNh4fug== X-CSE-MsgGUID: 6/fq2Ji/TVC/+93i7Yj/7w== X-IronPort-AV: E=Sophos;i="6.21,222,1763420400"; d="scan'208";a="380842713" Received: from secmail.uni-muenster.de ([128.176.118.4]) by UDCM-RELAY2.UNI-MUENSTER.DE with ESMTP; 13 Jan 2026 12:16:09 +0100 Received: from [192.168.178.27] (dynamic-002-243-227-134.2.243.pool.telefonica.de [2.243.227.134]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTPSA id CBFC720ADF03; Tue, 13 Jan 2026 12:16:08 +0100 (CET) Message-ID: <6eff5e43-cacd-4a2a-ad1d-e3b313c86050@uni-muenster.de> Date: Tue, 13 Jan 2026 12:16:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: ALTER TABLE: warn when actions do not recurse to partitions To: Chao Li , "David G. Johnston" Cc: Greg Sabino Mullane , Postgres hackers References: Content-Language: de-DE, en-GB From: Jim Jones In-Reply-To: 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 Hi Chao On 13/01/2026 05:02, Chao Li wrote: > > PSA v3: > > * Rephrased the notice message as David's suggestion. > * Removed partition count from notice message. > * If a partitioned table doesn't have any partition, then suppress the > message. I've been playing with this patch, and it seems to work as expected - I'm surprised it didn't break any existing tests :). Do you plan to extend this patch to other subcommands mentioned in your initial post, such as SET STATISTICS? Thanks for the patch Best, Jim == tests == CREATE TABLE m (a int NOT NULL, b int) PARTITION BY RANGE (a); CREATE TABLE m_p1 PARTITION OF m FOR VALUES FROM (1) TO (10); CREATE TABLE m_p2 PARTITION OF m FOR VALUES FROM (10) TO (20); CREATE UNIQUE INDEX m_idx ON m(a); CREATE UNIQUE INDEX m_p1_idx ON m_p1(a); CREATE UNIQUE INDEX m_p2_idx ON m_p2(a); CREATE TABLE CREATE TABLE CREATE TABLE CREATE INDEX CREATE INDEX CREATE INDEX -- issue a NOTICE (m has partitions) ALTER TABLE m REPLICA IDENTITY NOTHING; ALTER TABLE m REPLICA IDENTITY FULL; ALTER TABLE m REPLICA IDENTITY DEFAULT; ALTER TABLE m REPLICA IDENTITY USING INDEX m_idx; NOTICE: present partitions not affected HINT: partitions may be modified individually using separate commands ALTER TABLE NOTICE: present partitions not affected HINT: partitions may be modified individually using separate commands ALTER TABLE NOTICE: present partitions not affected HINT: partitions may be modified individually using separate commands ALTER TABLE NOTICE: present partitions not affected HINT: partitions may be modified individually using separate commands ALTER TABLE -- does not issue a NOTICE (with ONLY: no recursion into partitions) ALTER TABLE ONLY m REPLICA IDENTITY NOTHING; ALTER TABLE ONLY m REPLICA IDENTITY FULL; ALTER TABLE ONLY m REPLICA IDENTITY DEFAULT; ALTER TABLE ONLY m REPLICA IDENTITY USING INDEX m_idx; ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE -- does not issue a NOTICE (p1 has no partitions) ALTER TABLE m_p1 REPLICA IDENTITY NOTHING; ALTER TABLE m_p1 REPLICA IDENTITY FULL; ALTER TABLE m_p1 REPLICA IDENTITY DEFAULT; ALTER TABLE m_p1 REPLICA IDENTITY USING INDEX m_p1_idx; ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE -- does not issue a NOTICE (m no longer has partitions) DROP TABLE m_p1, m_p2; DROP TABLE ALTER TABLE m REPLICA IDENTITY NOTHING; ALTER TABLE m REPLICA IDENTITY FULL; ALTER TABLE m REPLICA IDENTITY DEFAULT; ALTER TABLE m REPLICA IDENTITY USING INDEX m_idx; ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE