pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ocean_li_996 <ocean_li_996@163.com>
To: songjinzhou <tsinghualucky912@foxmail.com>
Cc: Álvaro Herrera <alvherre@kurilemu.de>
Cc: mohen.lhy@alibaba-inc.com <mohen.lhy@alibaba-inc.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Cc: robertmhaas <robertmhaas@gmail.com>
Subject: Re: BUG #19070: issue with DETACH PARTITION CONCURRENTLY on ahash partition table
Date: Sat, 11 Oct 2025 16:02:59 +0800 (CST)
Message-ID: <5ca9d8f4.65cd.199d24b5fa6.Coremail.ocean_li_996@163.com> (raw)
In-Reply-To: <tencent_EA7D63A94134796E9642452AF86235FA3B08@qq.com>
References: <202510101057.2czghujtfz33@alvherre.pgsql>
	<17a8f848.b7f6.199cf1e3b5e.Coremail.ocean_li_996@163.com>
	<tencent_EA7D63A94134796E9642452AF86235FA3B08@qq.com>

Hello jinzhou,


Thanks for your opinion.


At 2025-10-11 10:00:54, "songjinzhou" <tsinghualucky912@foxmail.com> wrote:
> Hello hackers, Haiyang. I think the direct deletion of the DetachAddConstraintIfNeeded function in the patch above might not be a
> good idea. Will this create new problems?
> 
> Of the two solutions Haiyang mentioned earlier, is the second one more appropriate? Should it be deleted after detaching? For
> example, somewhere in the DetachPartitionFinalize function?


AFAICS, the mainly difference between "Direct deletion of the DetachAddConstraintIfNeeded function" (thought 1)
and "Adding constraint first and removing it later" (thought 2) is the moment after the first transaction commit
of detach concurrently. In that moment, thought 1 will not add a constraint on detached partition and thought 2 will.


However, detached partition still have a partition constraint, which is functionally redundant with the newly added
constraint for a partition table. Regarding the partitioned table, once first transaction has committed, the partition
can be regarded as already detached from its parent. Therefore, I’m inclined to go with thought 1.


--
regards
Haiyang Li



view thread (8+ messages)  latest in thread

Message-ID: <5ca9d8f4.65cd.199d24b5fa6.Coremail.ocean_li_996@163.com>
Permalink:  ../5ca9d8f4.65cd.199d24b5fa6.Coremail.ocean_li_996@163.com/
Also on:    postgresql.org/message-id/5ca9d8f4.65cd.199d24b5fa6.Coremail.ocean_li_996@163.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: ocean_li_996@163.com, tsinghualucky912@foxmail.com, alvherre@kurilemu.de, mohen.lhy@alibaba-inc.com, pgsql-bugs@lists.postgresql.org, robertmhaas@gmail.com
  Subject: Re: BUG #19070: issue with DETACH PARTITION CONCURRENTLY on ahash partition table
  In-Reply-To: <5ca9d8f4.65cd.199d24b5fa6.Coremail.ocean_li_996@163.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox