Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4AeY-0005sh-0b for pgsql-bugs@arkaria.postgresql.org; Sun, 23 Sep 2018 20:06:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4AeW-0007p9-J2 for pgsql-bugs@arkaria.postgresql.org; Sun, 23 Sep 2018 20:06:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4AeW-0007p2-DE for pgsql-bugs@lists.postgresql.org; Sun, 23 Sep 2018 20:06:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4AeU-0001YU-D9 for pgsql-bugs@lists.postgresql.org; Sun, 23 Sep 2018 20:06:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8NK6h1m000609; Sun, 23 Sep 2018 16:06:43 -0400 From: Tom Lane To: mat@timescale.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15395: Assert failure when using CURRENT OF with inheritance In-reply-to: <25035.1537726091@sss.pgh.pa.us> References: <153764171023.14986.280404050547008575@wrigleys.postgresql.org> <25035.1537726091@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 23 Sep 2018 14:08:11 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <607.1537733203.1@sss.pgh.pa.us> Date: Sun, 23 Sep 2018 16:06:43 -0400 Message-ID: <608.1537733203@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > I've not tried yet to create an actual test case for the chgParam-based > failure. It's definitely possible that that problem is only hypothetical > at the moment because cursor plans that would satisfy search_plan_tree > would be too simple to contain any such flags. But I think we'd better > add that logic anyway. After fooling with that for awhile longer, indeed there doesn't seem to be a way to cause such a failure today. The closest thing I was able to find was that an InitPlan's output params could get marked for recalculation, resulting in chgParam getting set on nodes that reference the InitPlan. A cursor query could certainly contain an InitPlan --- but there doesn't seem to be any code path that would result in forcing recalculation of one, except with things that couldn't be in a simple cursor plan, such as NestLoop joins. Still, it's not real hard to conceive of future changes that would render this a live issue, so I still feel that the search_plan_tree change is a good idea. So, I've added a test case based on your example and pushed the patch. BTW, I don't understand your report that just removing the Assert made it work for you. That would've resulted in returning an invalid TID to nodeTidscan.c, which AFAICS should've ended up with an ereport about a bad block number in heap_fetch. regards, tom lane