Re: BUG #19100: Different column type between partitioned table and detached pending partition table make errors

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mohen(dot)lhy(at)alibaba-inc(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19100: Different column type between partitioned table and detached pending partition table make errors
Date: 2025-11-02 18:36:12
Message-ID: 442267.1762108572@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message dqetool 2025-11-03 02:48:34 Re:Re: BUG #19101: Ceil on BIGINT could lost precision in decil function
Previous Message Tom Lane 2025-11-02 18:27:54 Re: Inconsistencies around Composite Row nullness