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 202406291756.2d3bmapza7z5@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  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-bugs
On 2024-Jun-29, Laurenz Albe wrote:

> My example that triggered this assert runs just fine on v16.

Well, in a build without assertions enabled then yes it doesn't crash.
But if you do have asserts enabled in 16, it does crash.

> So while an error is clearly better than a crash, that would constitute
> a regression.  Is that really unavoidable?  It would be very unfortunate
> if the only way to detach a partition would be to drop some indexes first...

The error would not occur on detach, but on attach, and it'd be intended
to prevent an inconsistent situation.  I'm proposing that on older
branches we do what Tender proposed elsewhere, namely to cope with the
detach without crashing (and without leaving inconsistent catalog state,
such as bogus coninhcount values).

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Pero la cosa no es muy grave ..."     (le petit Nicolas -- René Goscinny)



pgsql-bugs by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert
Next
From: Laurenz Albe
Date:
Subject: Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert