Re: BUG #16276: Server crash on an invalid attempt to attach apartition to an index - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #16276: Server crash on an invalid attempt to attach apartition to an index
Date
Msg-id 20200227023120.GC1969@paquier.xyz
Whole thread Raw
In response to Re: BUG #16276: Server crash on an invalid attempt to attach apartition to an index  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #16276: Server crash on an invalid attempt to attach apartition to an index
List pgsql-bugs
On Wed, Feb 26, 2020 at 05:06:24PM +0900, Michael Paquier wrote:
> Attempting to attach a table to a partitioned index?  Nice thought.
> Without the assertion, RangeVarCallbackForAttachIndex complains that
> the relation is not an index, which is right, so I would be tempted to
> just remove the culprit assertion.  Any thoughts?

FWIW, one can note that ALTER TABLE ATTACH PARTITION with indexes
correctly registers partition indexes without partition bounds in
pg_class, even if the grammar cannot accept ALTER TABLE without any
bounds defined:
create table idxpart(a int) partition by list (a);
create table idxpart1 partition of idxpart for values in (1);
create index idxpart_idx on only idxpart(a);
create index idxpart1_idx on only idxpart1(a);
alter table idxpart_idx attach partition idxpart1_idx for values in (0);

So I would rather not issue an error in that case on compatibility
ground.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Andreas Lennartsson
Date:
Subject: Re: BUG #16277: xmlelement allows invalid XML characters when XMLversion is set to 1.0
Next
From: Amit Langote
Date:
Subject: Re: BUG #16276: Server crash on an invalid attempt to attach apartition to an index