Re: BUG #18371: There are wrong constraint residues when detach hash partiton concurrently

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: feichanghong <feichanghong@qq.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2025-10-11T18:35:36Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Stop creating constraints during DETACH CONCURRENTLY

  2. Rename SLRU elements in view pg_stat_slru

On 2024-Jul-15, alvherre wrote:

> We should definitely not have this constraint on hash-partition tables
> after the detach.  However, I wonder if instead of adding it and later
> removing it as you propose, it wouldn't be better to just not add it in
> the first place.  As a first step, I tried commenting out and found that
> no interesting test fails (only alter_table.sql fails but only because
> the constraint is not there when looking for it specifically.)

Pushed a fix for this per report in
https://postgr.es/m/19070-781326347ade7c57@postgresql.org

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
<Schwern> It does it in a really, really complicated way
<crab> why does it need to be complicated?
<Schwern> Because it's MakeMaker.