------------------------------------------------------------------
From:Tom Lane <tgl@sss.pgh.pa.us>
Send Time:2025年11月3日(周一) 02:36
To:"李海洋(陌痕)"<mohen.lhy@alibaba-inc.com>
CC:"pgsql-bugs"<pgsql-bugs@lists.postgresql.org>
Subject:Re: BUG #19100: Different column type between partitioned table and detached pending partition table make errors
PG Bug reporting form <noreply@postgresql.org> 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