Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qDQvI-0001C4-C8 for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Jun 2023 14:41:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qDQvG-0001gD-F6 for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Jun 2023 14:41:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qDQvG-0001g3-6j for pgsql-bugs@lists.postgresql.org; Sun, 25 Jun 2023 14:41:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qDQvE-000PFK-50 for pgsql-bugs@lists.postgresql.org; Sun, 25 Jun 2023 14:41:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 35PEewFK509916; Sun, 25 Jun 2023 10:40:58 -0400 From: Tom Lane To: exclusion@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index In-reply-to: <17997-a044c27aef95daf8@postgresql.org> References: <17997-a044c27aef95daf8@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 25 Jun 2023 12:00:01 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <509914.1687704058.1@sss.pgh.pa.us> Date: Sun, 25 Jun 2023 10:40:58 -0400 Message-ID: <509915.1687704058@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > The following script: > create table t(a int) partition by range (a); > create index on t(a); > create table tp1(a int) partition by range (a); > create table tp1_1 partition of tp1 for values from (1) to (10); > create index on only tp1(a); > alter table t attach partition tp1 for values from (1) to (100); > create index on tp1_1(a); > \d+ t > \d+ tp1 > alter index tp1_a_idx attach partition tp1_1_a_idx; > ... triggers an assertion failure with the following stack trace: > #5 0x000055b6a19eb40f in ExceptionalCondition ( > conditionName=0x55b6a1ff8800 "!parentIdx->rd_index->indisvalid", > fileName=0x55b6a1fea7e0 "tablecmds.c", > lineNumber=19206) at assert.c:66 > #6 0x000055b6a038ea9d in validatePartitionedIndex > (partedIdx=0x7fc6e68a3ec8, partedTbl=0x7fc6e68a2368) > at tablecmds.c:19206 Thanks for the report! This is not new in 16, it reproduces at least as far back as v11. I suppose we can't simply remove the assertion, but have to figure out what should happen and write code for that. regards, tom lane