Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index - Mailing list pgsql-bugs

From Alexander Lakhin
Subject Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index
Date
Msg-id 14987634-43c0-0cb3-e075-94d423607e08@gmail.com
Whole thread Raw
In response to Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index
List pgsql-bugs
26.06.2023 11:05, Michael Paquier wrote:
> A third solution that came into my mind just now would be to revisit
> the choice done in AttachPartitionEnsureIndexes() where an invalid
> index can be chosen as a match when creating the indexes on the
> partitions, so as we are able to get to the bottom of a chain with
> valid indexes for the whole tree.  I have been testing the attached
> and it has been working here the way I'd expect when manipulating
> partition trees with ATTACH PARTITION, though this breaks the scenario
> of this bug report because we would now get a failure when attempting
> to attach an index in the last command.

Thanks for the fix!

This solution seems sensible to me. The only downside I see is that an
invalid index would be left orphaned after ATTACH PARTITION, but I couldn't
find in doc/ or src/test/regress/ any promises that such index must be
used. I also don't see a way to make a previously valid index inside the
partition index tree invalid and available to attaching a child index to it
in the same time.

Beside that, maybe it would be better to place the test for the fix in
indexing.sql, where many similar operations with partitioned indexes are
performed.

Best regards,
Alexander



pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #18000: Access method used by matview can be dropped leaving broken matview
Next
From: PG Bug reporting form
Date:
Subject: BUG #18002: Duplicate entries of row possible even after having primary key