Re: BUG #16276: Server crash on an invalid attempt to attach a partition to an index
Amit Langote <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>,
Alvaro Herrera <alvherre@2ndquadrant.com>
Date: 2020-03-10T14:25:53Z
Lists: pgsql-bugs
On Tue, Mar 3, 2020 at 2:01 PM Michael Paquier <michael@paquier.xyz> wrote: > On Mon, Mar 02, 2020 at 07:39:44PM +0900, Amit Langote wrote: > > Done, please see attached. > > Thanks. There are actually some safeguards in ATPrepCmd()@tablecmds.c > when calling ATSimplePermissions(). However, as this is checked for > both (ATT_TABLE | ATT_PARTITIONED_INDEX) then it would not blow up as > ALTER INDEX and ALTER TABLE use the same code path. Using DETACH > partition triggers this code path's error though, making the hint > added in your patch actually correct. > > So, applied this stuff down to 11, with test cases on all branches. I > have added a test case with ALTER TABLE DETACH PARTITION for an index > while on it. As the error is triggered at transformation time which > is a tad more generic than the work done in tablecmds.c for each > command, I have also removed the error hint and kept the code > simpler. Thank you. (I totally missed this email.) - Amit
Commits
-
Fix assertion failure with ALTER TABLE ATTACH PARTITION and indexes
- 75839fcf829f 11.8 landed
- dc8364824f80 12.3 landed
- 0b48f1335ddd 13.0 landed