Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xUVbc-000000010hP-0XXM for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Nov 2026 20:53:12 +0000 Received: from localhost ([127.0.0.1]:43038 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xUVbb-0000000Ba6E-1r5Y for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Nov 2026 20:53:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:47174) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xUVbb-0000000Ba64-0jEq for pgsql-bugs@lists.postgresql.org; Fri, 20 Nov 2026 20:53:11 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xUVbX-00000000nzM-2Jp7 for pgsql-bugs@lists.postgresql.org; Fri, 20 Nov 2026 20:53:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 6AKKr5Ho1713252; Fri, 20 Nov 2026 15:53:05 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6AKKr5Ho1713252 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1795207985; bh=FXABXEdRZmWuly52GIfssl8kOXrXq+0S0ZW9nGQnzOM=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=jILXj6AB097W9ehJDomXm1LGvV7fS19oNviwfZrGfBLLct0vbBvEH5Pah9sn1Ye3L iLMk8QpHUSfPOpw5gl5RavvuGIXMoVUm7pIp1RfQuROMrEX3zI32ii2Vm6M7D4+0Er Yu67zfVB7Bnc+K789KwWvIvGmnhouCe1sTgy3mVk= From: Tom Lane To: hackerzheng666@gmail.com cc: pgsql-bugs@lists.postgresql.org, Robert Haas Subject: Re: BUG #19924: unrecognized node type in create_plan_recurse: UNION, LIMIT, json_populate_recordset, inheritance In-reply-to: <19924-8aecd924385fafcc@postgresql.org> References: <19924-8aecd924385fafcc@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 20 Nov 2026 06:25:27 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1713250.1795207985.1@sss.pgh.pa.us> Date: Fri, 20 Nov 2026 15:53:05 -0500 Message-ID: <1713251.1795207985@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: > A UNION (with duplicate elimination) of two identical queries, each with > json_populate_recordset() in the select list over a join that involves a > table with an inheritance child, together with a LIMIT, fails in the planner > with an internal error whose node tag is a garbage number. Yeah, that's pretty clearly a pfree'd Path node. I tried git-bisecting this, and got an unhelpful-looking result: 8300d3ad4aa73dc6beec8dca7d9362dbc21c9a83 is the first bad commit commit 8300d3ad4aa73dc6beec8dca7d9362dbc21c9a83 (HEAD) Author: Robert Haas Date: Mon Mar 9 08:16:30 2026 -0400 Consider startup cost as a figure of merit for partial paths. I suspect what this is telling us is that the bug predates that, but by chance this example didn't fail earlier because our cost heuristics didn't lead us to choose the broken path. Valgrind doesn't find anything useful either: it is able to report use of an uninitialized value, but it doesn't track where the lost Path was allocated or freed. Not sure about a productive way to narrow this down :-( regards, tom lane