Re: BUG #16276: Server crash on an invalid attempt to attach a partition to an index

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: exclusion(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: BUG #16276: Server crash on an invalid attempt to attach a partition to an index
Date: 2020-03-10 14:25:53
Message-ID: CA+HiwqFgd9mBtZncevKNeTG8jo_LC+dTWVNvgdxD64ssopyBcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Mar 3, 2020 at 2:01 PM Michael Paquier <michael(at)paquier(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2020-03-10 15:35:13 Re: BUG #16291: Installation
Previous Message Peter Eisentraut 2020-03-10 13:33:47 Re: Wrong de translation for commands/tablecmds.c:5028