Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert
Date
Msg-id 202407041217.tei7dtplpymg@alvherre.pgsql
Whole thread Raw
In response to Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert
List pgsql-bugs
Doh, somehow I forgot the patches once again.  Here they are.  I intend
to push 0001 to all relevant branches soon, then park the rest until we
have ALTER TABLE ... ADD PRIMARY KEY USING INDEX.

On 2024-Jul-03, Alvaro Herrera wrote:

> So here are three patches.  0001 adds a check at DETACH time so that if
> a constraint has the form that we don't want to see, it copes without
> crashing in the way Tender suggested.  The code is different though,
> mainly because we don't need his proposed has_superclass() function.  It
> also adds the test cases, and leaves one of the tables from it so that
> pg_upgrade is tested.
> 
> 0002 is the code that throws an error in any of the three problem cases;
> roughly the same as the patch I posted as 0001 upthread.  This is
> incomplete in the sense that the regression tests would fail with it,
> because I didn't modify the results.  (I think we'd also remove the
> DETACH line from those tests, because it'd be useless).
> 
> 0003 adds the pg_upgrade check I mentioned: it scans the databases in
> the source cluster for any constraints of the bogus form and fails the
> upgrade if any exist.  I tested this one very lightly (that is to say,
> only with the database state left by the tests in 0001).

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/

Attachment

pgsql-bugs by date:

Previous
From: Tender Wang
Date:
Subject: Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert
Next
From: Erik Wienhold
Date:
Subject: Re: BUG #18529: Can not install as Document