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.94.2) (envelope-from ) id 1vFcwA-00ExDv-AW for pgsql-bugs@arkaria.postgresql.org; Sun, 02 Nov 2025 18:36:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vFcw9-00DCqM-Aw for pgsql-bugs@arkaria.postgresql.org; Sun, 02 Nov 2025 18:36:20 +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.94.2) (envelope-from ) id 1vFcw9-00DCqD-2Q for pgsql-bugs@lists.postgresql.org; Sun, 02 Nov 2025 18:36:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vFcw5-005cAz-1i for pgsql-bugs@lists.postgresql.org; Sun, 02 Nov 2025 18:36:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 5A2IaCf3442268; Sun, 2 Nov 2025 13:36:12 -0500 From: Tom Lane To: mohen.lhy@alibaba-inc.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19100: Different column type between partitioned table and detached pending partition table make errors In-reply-to: <19100-f676a0f5c4723b2f@postgresql.org> References: <19100-f676a0f5c4723b2f@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 01 Nov 2025 18:36:26 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <442266.1762108572.1@sss.pgh.pa.us> Date: Sun, 02 Nov 2025 13:36:12 -0500 Message-ID: <442267.1762108572@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > It's evident that in both error cases, the failure occurs because > column name has different data types between the parent and the child > table. BTW, "\d+ users_p0" error happens when > pg_get_partition_constraintdef() is called. The root cause seems to be > that when running: > ``` > ALTER TABLE users ALTER COLUMN name TYPE char(10); > ``` > on the parent table, the statement does not affect a child table that is in > detach pending state. Ugh. > IMO, a detach pending child table is not affected by parent's DML or DQL, > but should still be affected by parent's DDL. I think it'd be far safer to refuse all forms of ALTER TABLE until the detach is completed. regards, tom lane