Re: set relispartition when attaching child index

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Amit Langote <amitlangote09(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: set relispartition when attaching child index
Date: 2019-04-25 01:11:04
Message-ID: 3a8ac3ba-990e-e411-41dd-8c6f67e0b81d@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019/04/25 0:55, Amit Langote wrote:
> On Thu, Apr 25, 2019 at 12:39 AM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>> On Thu, Apr 25, 2019 at 12:38 AM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>>> On Thu, Apr 25, 2019 at 12:35 AM Alvaro Herrera
>>> <alvherre(at)2ndquadrant(dot)com> wrote:
>>>> On 2019-Apr-25, Amit Langote wrote:
>>>>
>>>>> It seems that DefineIndex() is forgetting to update_relispartition()
>>>>> on a partition's index when it's attached to an index being added to
>>>>> the parent. That results in unexpected behavior when adding a foreign
>>>>> key referencing the parent.
>>>>
>>>> BTW, maybe IndexSetParentIndex ought to be the one calling
>>>> update_relispartition() ...
>>>
>>> I thought so too, but other sites are doing what I did in the patch.
>>
>> Although, we wouldn't have this bug if it was IndexSetParentIndex
>> calling it. Maybe a good idea to do that now.
>
> I tried that in the attached.

BTW, this will need to be back-patched to 11.

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message alex lock 2019-04-25 01:53:11 Re: Help to review the with X cursor option.
Previous Message Michael Paquier 2019-04-25 00:55:44 Re: Identity columns should own only one sequence