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>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tender Wang <tndrwang@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2024-07-04T12:17:08Z
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 →
-
Fix ALTER TABLE DETACH for inconsistent indexes
- d0054432d480 12.20 landed
- 83917791385a 18.0 landed
- 66aaa7a71841 14.13 landed
- 4ae09c59d6f5 15.8 landed
- 30ca4e1ab1ff 17.0 landed
- 05748256939b 13.16 landed
- 00a40e33c0a4 16.4 landed
Attachments
- v3-0001-Cope-at-DETACH-time-for-12-16.patch (text/x-diff)
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/