Re: create partition table caused server crashed with self-referencing foreign key

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: amul sul <sulamul(at)gmail(dot)com>
Cc: Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: create partition table caused server crashed with self-referencing foreign key
Date: 2020-04-22 10:21:21
Message-ID: CAApHDvpjyHTQPF5Bf6weGM+i2D-=pAF9ASzM2r0PWob0+m=nMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 22 Apr 2020 at 21:30, amul sul <sulamul(at)gmail(dot)com> wrote:
>
> On Wed, Apr 22, 2020 at 2:27 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>>
>> On Wed, 22 Apr 2020 at 20:11, amul sul <sulamul(at)gmail(dot)com> wrote:
>> >
>> > On Wed, Apr 22, 2020 at 1:21 PM Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com> wrote:
>> >> #2 0x0000000000acd16a in ExceptionalCondition (conditionName=0xc32310 "numfks == attmap->maplen", errorType=0xc2ea23 "FailedAssertion", fileName=0xc2f0bf "tablecmds.c", lineNumber=9046) at assert.c:67
>> >
>> >
>> > Looks like this assertion is incorrect, I guess it should have check
>> > numfks <= attmap->maplen instead.
>>
>> Even that seems like a very strange thing to Assert. Basically it's
>> saying, make sure the number of columns in the foreign key constraint
>> is less than or equal to the number of attributes in parentRel.
>>
>> It's true we do disallow duplicate column names in the foreign key
>> constraint (at least since 9da867537), but why do we want an Assert to
>> say that? I don't see anything about that code that would break if we
>> did happen to allow duplicate columns in the foreign key. I'd say the
>> Assert should just be removed completely.
>
>
> Understood and agree with you.

I pushed a patch to remove the Assert. I didn't really feel a need to
make any adjustments to the regression tests for this. The Assert was
clearly out of place, it's hard to imagine that this could ever get
broken again.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ahsan Hadi 2020-04-22 10:44:07 Re: create partition table caused server crashed with self-referencing foreign key
Previous Message amul sul 2020-04-22 09:44:27 Re: create partition table caused server crashed with self-referencing foreign key