Re: Partitioned index marked valid while a partition is pending detach

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: alvherre(at)kurilemu(dot)de, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Partitioned index marked valid while a partition is pending detach
Date: 2026-11-08 03:42:22
Message-ID: CAGRkXqTbOH1EXpO158LyJP8bB+vuyCN_TT89V+tp8eeNTxrV7g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 06, 2026 at 10:58:41AM +0900, Michael Paquier wrote:
> Perhaps we should try to work around simplifying
> RelationGetPartitionDesc() instead, and try to get rid of the
> omit_detached idea entirely?

Thanks, that made the fix much simpler. v4-0003 removes the
omit_detached argument of RelationGetPartitionDesc(), so DDL on the
parent now reaches a partition pending detach. FINALIZE then works
after ADD CHECK or RENAME COLUMN on the parent. This holds when
the partition is two levels down too.

I could not delete omit_detached entirely. Queries still need it, and
without it detach-partition-concurrently-1 to 4 fail.

0001 and 0002 work as is on 15 to 19. 0003 changes an API, so master only

Thanks,
Shihao

Attachment Content-Type Size
v3-0003-Let-DDL-see-partitions-pending-detach.patch application/octet-stream 18.5 KB
v3-0002-Test-partitioned-index-validity-while-a-partition-is.patch application/octet-stream 4.3 KB
v3-0001-Count-partitions-pending-detach-when-validating-a-pa.patch application/octet-stream 1.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-11-08 04:03:25 Re: aio tests failing on newer Linux kernels
Previous Message shihao zhong 2026-11-08 02:56:39 Re: Fix stale column context after COPY FROM conversion errors